bugfix return
This commit is contained in:
parent
d7016df1ba
commit
6948797001
@ -140,8 +140,12 @@ public class ASTGenerator extends DecafBaseVisitor<Node> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Node visitReturnStmt(DecafParser.ReturnStmtContext ctx) {
|
public Node visitReturnStmt(DecafParser.ReturnStmtContext ctx) {
|
||||||
Node expression = visitExpression(ctx.expression());
|
if (ctx.expression() != null) {
|
||||||
return new ReturnStatement((IExpression) expression);
|
Node expression = visitExpression(ctx.expression());
|
||||||
|
return new ReturnStatement((IExpression) expression);
|
||||||
|
} else {
|
||||||
|
return new ReturnStatement(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user