fix format bug for elsestme and stmt def in .g4

This commit is contained in:
Downright
2025-03-05 13:43:27 +08:00
parent 6f51e76804
commit 51ed88f761
4 changed files with 4 additions and 3 deletions

View File

@@ -155,7 +155,7 @@ std::any ASTPrinter::visitStmt(SysYParser::StmtContext *ctx){
cout << getIndent() << "}" << endl;
}
if (ctx->stmt().size() > 1) {
cout << getIndent() << "else" << endl;
cout << getIndent() << "else";
if(ctx->stmt(1)->blockStmt())ctx->stmt(1)->accept(this);
else{
cout << " {"<< endl;