From 1d51112f965c536fa635ef17de7a3585edc724bb Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Thu, 22 Aug 2019 19:04:50 +0800 Subject: [PATCH] Bug fixed --- version0.5/nasal_parse.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/version0.5/nasal_parse.h b/version0.5/nasal_parse.h index d316d5f..04ddb5c 100644 --- a/version0.5/nasal_parse.h +++ b/version0.5/nasal_parse.h @@ -250,6 +250,16 @@ bool parse::scalars_reduction() parser.push(t); return true; } + else if((tbl[2]!=__scalar) && (tbl[2]!=__identifier) && (tbl[1]==__sub_operator) && (tbl[0]==__scalar)) + { + parse_unit t; + t.type=__scalar;// ! + t.line=parser.top().line; + for(int i=0;i<2;++i) + parser.pop(); + parser.push(t); + return true; + } else if(((tbl[2]==__identifier) || (tbl[2]==__identifiers)) && (tbl[1]==__comma) && (tbl[0]==__scalar)) { parse_unit t; @@ -291,6 +301,16 @@ bool parse::identifier_check() parser.push(t); return true; } + else if((tbl[2]!=__scalar) && (tbl[2]!=__identifier) && (tbl[1]==__sub_operator) && (tbl[0]==__identifier)) + { + parse_unit t; + t.type=__identifier; + t.line=parser.top().line; + for(int i=0;i<2;++i) + parser.pop(); + parser.push(t); + return true; + } else if((tbl[2]==__identifier) && (tbl[1]==__dot) && (tbl[0]==__identifier)) { parse_unit t; @@ -1119,6 +1139,7 @@ void parse::print_parser(token_list& lexer) bool reduction_complete=false; while(!reduction_complete) { + if(scalars_reduction()) { std::cout<<"line "<