+added support to get a value by an accessor in a print statement.
This commit is contained in:
parent
15f8eb3b5e
commit
f5057fd859
3
HISTORY
3
HISTORY
@ -1,5 +1,6 @@
|
|||||||
Dec. 17 2015
|
Dec. 17 2015
|
||||||
Added support to evaluate a sub routine by an accessor in PRINT statement
|
Added support to evaluate a sub routine by an accessor in a PRINT statement
|
||||||
|
Added support to get a value by an accessor in a PRINT statement
|
||||||
|
|
||||||
Dec. 15 2015
|
Dec. 15 2015
|
||||||
Added a pair of mb_begin_class/mb_end_class functions
|
Added a pair of mb_begin_class/mb_end_class functions
|
||||||
|
@ -11793,11 +11793,26 @@ int _std_print(mb_interpreter_t* s, void** l) {
|
|||||||
switch(obj->type) {
|
switch(obj->type) {
|
||||||
case _DT_VAR:
|
case _DT_VAR:
|
||||||
if(obj->data.variable->pathing) {
|
if(obj->data.variable->pathing) {
|
||||||
|
_ls_node_t* pathed = _search_identifier_in_scope_chain(s, 0, obj->data.variable->name, obj->data.variable->pathing, 0);
|
||||||
|
if(pathed && pathed->data) {
|
||||||
|
if(obj != (_object_t*)pathed->data) {
|
||||||
|
obj = (_object_t*)pathed->data;
|
||||||
|
|
||||||
|
if(obj->type == _DT_ROUTINE) {
|
||||||
_execute_statement(s, &ast);
|
_execute_statement(s, &ast);
|
||||||
_MAKE_NIL(&tmp);
|
_MAKE_NIL(&tmp);
|
||||||
_public_value_to_internal_object(&s->running_context->intermediate_value, &tmp);
|
_public_value_to_internal_object(&s->running_context->intermediate_value, &tmp);
|
||||||
val_ptr = obj = &tmp;
|
val_ptr = obj = &tmp;
|
||||||
if(ast) ast = ast->prev;
|
if(ast) ast = ast->prev;
|
||||||
|
} else if(obj->type == _DT_VAR) {
|
||||||
|
val_ptr = obj = obj->data.variable->data;
|
||||||
|
if(ast) ast = ast->next;
|
||||||
|
} else {
|
||||||
|
val_ptr = obj;
|
||||||
|
if(ast) ast = ast->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
goto _print;
|
goto _print;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user