bug report and example fix for issue1
This commit is contained in:
@@ -227,7 +227,10 @@ std::any ASTPrinter::visitUnaryExp(SysYParser::UnaryExpContext *ctx){
|
|||||||
cout << ctx->Ident()->getText() << ctx->LPAREN()->getText();
|
cout << ctx->Ident()->getText() << ctx->LPAREN()->getText();
|
||||||
if(ctx->funcRParams())
|
if(ctx->funcRParams())
|
||||||
ctx->funcRParams()->accept(this);
|
ctx->funcRParams()->accept(this);
|
||||||
cout << ctx->RPAREN()->getText();
|
if (ctx->RPAREN())
|
||||||
|
cout << ctx->RPAREN()->getText();
|
||||||
|
else
|
||||||
|
cout << "<missing \')\'?>";
|
||||||
}
|
}
|
||||||
else if(ctx->unaryExp()){
|
else if(ctx->unaryExp()){
|
||||||
cout << ctx->unaryOp()->getText();
|
cout << ctx->unaryOp()->getText();
|
||||||
|
|||||||
7
test/bug1.sy
Normal file
7
test/bug1.sy
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
// bug1: getint(;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int a;
|
||||||
|
a = getint(;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user