fix block in constructor in ast
This commit is contained in:
parent
b00979c1a8
commit
c96d9fc1a1
@ -67,7 +67,8 @@ public class ASTGenerator extends DecafBaseVisitor<Node> {
|
||||
public Node visitConstuctorDecl(DecafParser.ConstuctorDeclContext ctx) {
|
||||
String name = ctx.Identifier().getText();
|
||||
ParameterList parameterList = (ParameterList) visit(ctx.parameterList());
|
||||
return new MethodDecl("", null, name, parameterList, new BlockStatement(new ArrayList<>(), "void"));
|
||||
BlockStatement block = (BlockStatement) visitBlock(ctx.block());
|
||||
return new MethodDecl("", null, name, parameterList, block);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user