Fixed a bug.

This commit is contained in:
Valk Richard Li 2019-11-20 23:46:17 +08:00 committed by GitHub
parent f7f6eb9ea3
commit 45559eef30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -428,7 +428,10 @@ bool abstract_syntax_tree::condition_check()
return false;
}
if(type==__null_node) // this is set for "for(;;)"
{
--recursion_depth;
return true;
}
bool ret=false;
var temp=calculation();
if(temp.get_type()==__var_number)
@ -464,6 +467,7 @@ var abstract_syntax_tree::call_identifier()
{
std::cout<<">>[Runtime-error] line "<<line<<": cannot find a var named \'"<<name<<"\'."<<std::endl;
exit_type=__find_var_failure;
--recursion_depth;
return temp;
}
if(!children.empty())