*fixed a calculation issue with the not statement.

This commit is contained in:
paladin-t 2016-04-11 19:10:25 +08:00
parent 1e74cc7121
commit 3641754004
2 changed files with 12 additions and 7 deletions

View File

@ -12647,18 +12647,23 @@ static int _core_not(mb_interpreter_t* s, void** l) {
if(ast) ast = ast->next;
calc_depth = running->calc_depth;
if(ast && _IS_FUNC((_object_t*)ast->data, _core_open_bracket))
running->calc_depth = _INFINITY_CALC_DEPTH;
else
running->calc_depth = 1;
mb_make_nil(arg);
if(ast && _IS_FUNC((_object_t*)ast->data, _core_open_bracket)) {
mb_check(mb_attempt_open_bracket(s, l));
mb_check(mb_attempt_func_begin(s, l));
mb_check(mb_pop_value(s, l, &arg));
mb_check(mb_pop_value(s, l, &arg));
mb_check(mb_attempt_close_bracket(s, l));
} else {
running->calc_depth = 1;
mb_check(mb_attempt_func_end(s, l));
mb_check(mb_attempt_func_begin(s, l));
mb_check(mb_pop_value(s, l, &arg));
mb_check(mb_attempt_func_end(s, l));
}
switch(arg.type) {
case MB_DT_NIL:

Binary file not shown.