diff --git a/HISTORY b/HISTORY index fd8b83f..a1009a9 100755 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +Apr. 11 2016 +Fixed a calculation issue with the NOT statement + Apr. 5 2016 Added a warning when a "tostring" meta method didn't return a string diff --git a/core/my_basic.c b/core/my_basic.c index 8d8d81b..24a918c 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -12635,6 +12635,7 @@ static int _core_or(mb_interpreter_t* s, void** l) { /* Operator NOT */ static int _core_not(mb_interpreter_t* s, void** l) { int result = MB_FUNC_OK; + _ls_node_t* ast = 0; mb_value_t arg; _running_context_t* running = 0; int calc_depth = 0; @@ -12642,9 +12643,14 @@ static int _core_not(mb_interpreter_t* s, void** l) { mb_assert(s && l); running = s->running_context; + ast = *l; + if(ast) ast = ast->next; calc_depth = running->calc_depth; - running->calc_depth = 1; + 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); diff --git a/output/my_basic.exe b/output/my_basic.exe index e3023d9..22a0e94 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ