Parser return bugfix

This commit is contained in:
laurenz 2024-05-20 16:52:36 +02:00
parent 3a267180ba
commit ca9f6cc06a

View File

@ -20,7 +20,7 @@ public class BlockGenerator extends DecafBaseVisitor<Block> {
}
}
if (ctx.return_() != null){
statements.add(ctx.return_().isEmpty() ? new Return(null) : new Return(new ExpressionGenerator().visit(ctx.return_())));
statements.add(ctx.return_().expr().isEmpty() ? new Return(null) : new Return(new ExpressionGenerator().visit(ctx.return_().expr())));
}
return new Block(statements);
}