fix a bug of issue1

This commit is contained in:
qzx
2025-03-06 11:22:13 +08:00
parent 0bfba3b0a2
commit a6f95366c8

View File

@@ -90,7 +90,10 @@ std::any ASTPrinter::visitFuncDef(SysYParser::FuncDefContext *ctx){
cout << getIndent() << ctx->funcType()->getText() << ' ' << ctx->Ident()->getText();
cout << ctx->LPAREN()->getText();
if (ctx->funcFParams()) ctx->funcFParams()->accept(this);
if(ctx->RPAREN())
cout << ctx->RPAREN()->getText();
else
cout << "<missing \')\'?>";
ctx->blockStmt()->accept(this);
return nullptr;
}