diff --git a/_config.yml b/_config.yml index 3397c9a..f2ede7c 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-architect \ No newline at end of file +theme: jekyll-theme-architect diff --git a/core/my_basic.c b/core/my_basic.c index c98bbc0..0ab9248 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -1343,6 +1343,10 @@ static int mb_uu_substr(const char* ch, int begin, int count, char** o); /** Expression processing */ +#ifndef _ONCOND +# define _ONCOND(__s, __o, __v) do { ((void)(__s)); ((void)(__o)); ((void)(__v)); } while(0) +#endif /* _ONCOND */ + static bool_t _is_operator(mb_func_t op); static bool_t _is_flow(mb_func_t op); static bool_t _is_unary(mb_func_t op); @@ -15110,6 +15114,7 @@ static int _core_not(mb_interpreter_t* s, void** l) { mb_check(mb_attempt_func_end(s, l)); } + _ONCOND(s, 0, &arg); switch(arg.type) { case MB_DT_NIL: @@ -15535,6 +15540,7 @@ static int _core_if(mb_interpreter_t* s, void** l) { _elseif: _MAKE_NIL(val); result = _calc_expression(s, &ast, &val); + _ONCOND(s, val, 0); if(result != MB_FUNC_OK) goto _exit; @@ -15819,6 +15825,7 @@ _loop_begin: ast = loop_begin_node; result = _calc_expression(s, &ast, &loop_cond_ptr); + _ONCOND(s, loop_cond_ptr, 0); if(result != MB_FUNC_OK) goto _exit; @@ -15932,6 +15939,7 @@ _loop_begin: ast = ast->next; result = _calc_expression(s, &ast, &loop_cond_ptr); + _ONCOND(s, loop_cond_ptr, 0); if(result != MB_FUNC_OK) goto _exit; diff --git a/shell/main.c b/shell/main.c index 0158b4d..208cd3f 100755 --- a/shell/main.c +++ b/shell/main.c @@ -97,7 +97,7 @@ extern "C" { #define _REALLOC_INC_STEP 16 -#define _NO_END(s) ((s) == MB_FUNC_OK || (s) == MB_FUNC_SUSPEND || (s) == MB_FUNC_WARNING || (s) == MB_FUNC_ERR || (s) == MB_FUNC_END) +#define _NOT_FINISHED(s) ((s) == MB_FUNC_OK || (s) == MB_FUNC_SUSPEND || (s) == MB_FUNC_WARNING || (s) == MB_FUNC_ERR || (s) == MB_FUNC_END) static struct mb_interpreter_t* bas = 0; @@ -993,9 +993,9 @@ static void _show_help(void) { _printf("Options:\n"); _printf(" -h - Show help information\n"); #if _USE_MEM_POOL - _printf(" -p n - Set memory pool threashold size, n is size in bytes\n"); + _printf(" -p n - Set memory pool threashold, n is size in bytes\n"); #endif /* _USE_MEM_POOL */ - _printf(" -f \"dirs\" - Set importing directories, separated with \";\" for more than one\n"); + _printf(" -f \"dirs\" - Set importing directories, separated with \";\" with more than one\n"); _printf("\n"); _printf("Interactive commands:\n"); _printf(" HELP - View help information\n"); @@ -1585,7 +1585,7 @@ int main(int argc, char* argv[]) { _show_tip(); do { status = _do_line(); - } while(_NO_END(status)); + } while(_NOT_FINISHED(status)); } return 0;