Bug fixed

This commit is contained in:
Valk Richard Li 2019-08-22 19:04:50 +08:00 committed by GitHub
parent 21b64e6287
commit 1d51112f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -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 "<<parser.top().line<<": Scalars"<<std::endl;