*fixed a variable pathing bug in lambda.
This commit is contained in:
parent
1340606c2c
commit
7508fd7b17
1
HISTORY
1
HISTORY
@ -1,5 +1,6 @@
|
|||||||
Mar. 1 2016
|
Mar. 1 2016
|
||||||
Added an OS statement
|
Added an OS statement
|
||||||
|
Fixed a variable pathing bug in lambda
|
||||||
Fixed a class type detection bug with the IS statement
|
Fixed a class type detection bug with the IS statement
|
||||||
Refactored platform dependent macros
|
Refactored platform dependent macros
|
||||||
|
|
||||||
|
@ -7569,6 +7569,9 @@ static int _fill_with_upvalue(void* data, void* extra, _upvalue_scope_tuple_t* t
|
|||||||
var->data->ref = true;
|
var->data->ref = true;
|
||||||
}
|
}
|
||||||
#ifdef MB_ENABLE_CLASS
|
#ifdef MB_ENABLE_CLASS
|
||||||
|
if(obj->type == _DT_VAR)
|
||||||
|
var->pathing = obj->data.variable->pathing;
|
||||||
|
else
|
||||||
var->pathing = 0;
|
var->pathing = 0;
|
||||||
#endif /* MB_ENABLE_CLASS */
|
#endif /* MB_ENABLE_CLASS */
|
||||||
ul = _ht_set_or_insert(tuple->outer_scope->scope->var_dict, ovar->data.variable->name, ovar);
|
ul = _ht_set_or_insert(tuple->outer_scope->scope->var_dict, ovar->data.variable->name, ovar);
|
||||||
@ -13835,7 +13838,11 @@ static int _core_lambda(mb_interpreter_t* s, void** l) {
|
|||||||
_mb_check_mark(mb_attempt_open_bracket(s, l), result, _error);
|
_mb_check_mark(mb_attempt_open_bracket(s, l), result, _error);
|
||||||
|
|
||||||
while(mb_has_arg(s, l)) {
|
while(mb_has_arg(s, l)) {
|
||||||
|
#ifdef MB_ENABLE_CLASS
|
||||||
|
bool_t pathing = false;
|
||||||
|
#endif /* MB_ENABLE_CLASS */
|
||||||
void* v = 0;
|
void* v = 0;
|
||||||
|
|
||||||
_mb_check_mark(mb_get_var(s, l, &v), result, _error);
|
_mb_check_mark(mb_get_var(s, l, &v), result, _error);
|
||||||
|
|
||||||
if(!routine->func.lambda.parameters)
|
if(!routine->func.lambda.parameters)
|
||||||
@ -13844,12 +13851,15 @@ static int _core_lambda(mb_interpreter_t* s, void** l) {
|
|||||||
_handle_error_on_obj(s, SE_RN_INVALID_LAMBDA, s->source_file, DON2(l), MB_FUNC_ERR, _error, result);
|
_handle_error_on_obj(s, SE_RN_INVALID_LAMBDA, s->source_file, DON2(l), MB_FUNC_ERR, _error, result);
|
||||||
}
|
}
|
||||||
var = ((_object_t*)v)->data.variable;
|
var = ((_object_t*)v)->data.variable;
|
||||||
|
#ifdef MB_ENABLE_CLASS
|
||||||
|
pathing = var->pathing;
|
||||||
|
#endif /* MB_ENABLE_CLASS */
|
||||||
|
|
||||||
/* Add lambda parameters */
|
/* Add lambda parameters */
|
||||||
obj = 0;
|
obj = 0;
|
||||||
var = _create_var(&obj, var->name, 0, true);
|
var = _create_var(&obj, var->name, 0, true);
|
||||||
#ifdef MB_ENABLE_CLASS
|
#ifdef MB_ENABLE_CLASS
|
||||||
var->pathing = 0;
|
var->pathing = pathing;
|
||||||
#endif /* MB_ENABLE_CLASS */
|
#endif /* MB_ENABLE_CLASS */
|
||||||
ul = _ht_set_or_insert(routine->func.lambda.scope->var_dict, var->name, obj);
|
ul = _ht_set_or_insert(routine->func.lambda.scope->var_dict, var->name, obj);
|
||||||
mb_assert(ul);
|
mb_assert(ul);
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user