*developing lambda, fixed an issue with only a PRINT statement.
This commit is contained in:
parent
6cb46f7ba9
commit
71ab22d995
3
HISTORY
3
HISTORY
@ -1,3 +1,6 @@
|
|||||||
|
Jan. 9 2016
|
||||||
|
Developing lambda, fixed an issue with only a PRINT statement
|
||||||
|
|
||||||
Jan. 8 2016
|
Jan. 8 2016
|
||||||
Developing lambda, fixed a lambda scope linkage issue
|
Developing lambda, fixed a lambda scope linkage issue
|
||||||
Developing lambda, fixed an upvalue passing issue
|
Developing lambda, fixed an upvalue passing issue
|
||||||
|
@ -439,6 +439,7 @@ typedef struct _lambda_t {
|
|||||||
struct _running_context_ref_t* outer_scope;
|
struct _running_context_ref_t* outer_scope;
|
||||||
_ht_node_t* upvalues;
|
_ht_node_t* upvalues;
|
||||||
_ls_node_t* entry;
|
_ls_node_t* entry;
|
||||||
|
_ls_node_t* end;
|
||||||
} _lambda_t;
|
} _lambda_t;
|
||||||
#endif /* MB_ENABLE_LAMBDA */
|
#endif /* MB_ENABLE_LAMBDA */
|
||||||
|
|
||||||
@ -7824,6 +7825,10 @@ _retry:
|
|||||||
_handle_error_on_obj(s, SE_RN_COLON_EXPECTED, 0, DON(ast), MB_FUNC_ERR, _exit, result);
|
_handle_error_on_obj(s, SE_RN_COLON_EXPECTED, 0, DON(ast), MB_FUNC_ERR, _exit, result);
|
||||||
} else if(_IS_FUNC(obj, _core_enddef) && result != MB_SUB_RETURN) {
|
} else if(_IS_FUNC(obj, _core_enddef) && result != MB_SUB_RETURN) {
|
||||||
ast = (_ls_node_t*)_ls_popback(sub_stack);
|
ast = (_ls_node_t*)_ls_popback(sub_stack);
|
||||||
|
#ifdef MB_ENABLE_LAMBDA
|
||||||
|
} else if(obj && _IS_FUNC(obj, _core_close_bracket) && s->last_routine && s->last_routine->type == _IT_LAMBDA) {
|
||||||
|
/* Do nothing */
|
||||||
|
#endif /* MB_ENABLE_LAMBDA */
|
||||||
} else if(obj && obj->type == _DT_FUNC && (_is_operator(obj->data.func->pointer) || _is_flow(obj->data.func->pointer))) {
|
} else if(obj && obj->type == _DT_FUNC && (_is_operator(obj->data.func->pointer) || _is_flow(obj->data.func->pointer))) {
|
||||||
ast = ast->next;
|
ast = ast->next;
|
||||||
} else if(obj && obj->type == _DT_FUNC) {
|
} else if(obj && obj->type == _DT_FUNC) {
|
||||||
@ -11981,6 +11986,7 @@ int _core_lambda(mb_interpreter_t* s, void** l) {
|
|||||||
ast = ast->next;
|
ast = ast->next;
|
||||||
}
|
}
|
||||||
*l = ast;
|
*l = ast;
|
||||||
|
routine->func.lambda.end = ast;
|
||||||
|
|
||||||
_mb_check_mark(mb_attempt_close_bracket(s, l), err, _error);
|
_mb_check_mark(mb_attempt_close_bracket(s, l), err, _error);
|
||||||
|
|
||||||
@ -13018,7 +13024,7 @@ _print:
|
|||||||
} else {
|
} else {
|
||||||
_handle_error_on_obj(s, SE_RN_COMMA_OR_SEMICOLON_EXPECTED, 0, DON(ast), MB_FUNC_ERR, _exit, result);
|
_handle_error_on_obj(s, SE_RN_COMMA_OR_SEMICOLON_EXPECTED, 0, DON(ast), MB_FUNC_ERR, _exit, result);
|
||||||
}
|
}
|
||||||
} while(ast && !_IS_SEP(obj, ':') && (obj->type == _DT_SEP || !_is_expression_terminal(s, obj)));
|
} while(ast && !_IS_SEP(obj, ':') && !_IS_FUNC(obj, _core_close_bracket) && (obj->type == _DT_SEP || !_is_expression_terminal(s, obj)));
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
--s->no_eat_comma_mark;
|
--s->no_eat_comma_mark;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user