mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-26 21:08:45 +08:00
bug fixed
This commit is contained in:
@@ -33,7 +33,7 @@ void nasal_parse::print_detail_token()
|
|||||||
std::string space="";
|
std::string space="";
|
||||||
int line=1;
|
int line=1;
|
||||||
std::cout<<line<<"\t";
|
std::cout<<line<<"\t";
|
||||||
while(!tmp.empty())
|
while(tmp.top().type!=__stack_end)
|
||||||
{
|
{
|
||||||
if(tmp.top().line!=line)
|
if(tmp.top().line!=line)
|
||||||
{
|
{
|
||||||
@@ -135,7 +135,7 @@ void nasal_parse::main_generate()
|
|||||||
root.set_line(1);
|
root.set_line(1);
|
||||||
root.set_type(__root);
|
root.set_type(__root);
|
||||||
// initialize root node
|
// initialize root node
|
||||||
while(!parse_token_stream.empty())
|
while(parse_token_stream.top().type!=__stack_end)
|
||||||
{
|
{
|
||||||
this->get_token();
|
this->get_token();
|
||||||
switch(this_token.type)
|
switch(this_token.type)
|
||||||
@@ -160,6 +160,7 @@ void nasal_parse::main_generate()
|
|||||||
root.add_child(loop_expr());
|
root.add_child(loop_expr());
|
||||||
break;
|
break;
|
||||||
case __semi:break;
|
case __semi:break;
|
||||||
|
case __stack_end:break;
|
||||||
default:
|
default:
|
||||||
++error;
|
++error;
|
||||||
print_parse_error(error_token_in_main,this_token.line,this_token.type);
|
print_parse_error(error_token_in_main,this_token.line,this_token.type);
|
||||||
|
|||||||
Reference in New Issue
Block a user