diff --git a/balloon/abstract_syntax_tree.cpp b/balloon/abstract_syntax_tree.cpp index c92f247..019a1e9 100644 --- a/balloon/abstract_syntax_tree.cpp +++ b/balloon/abstract_syntax_tree.cpp @@ -673,13 +673,23 @@ void abstract_syntax_tree::run_root() else if(i->type==__while) { scope.add_new_block_scope(); - i->run_loop(); + int ret_type=i->run_loop(); + if(ret_type==__return) + { + std::cout<<"[Runtime-error] line "<type==__ifelse) { scope.add_new_block_scope(); - i->run_ifelse(); + int ret_type=i->run_ifelse(); + if(ret_type==__continue || ret_type==__break || ret_type==__return) + { + std::cout<<"[Runtime-error] line "<& get_resource()