add missing type declarations to pretty print output

This commit is contained in:
2020-02-04 00:16:00 +01:00
parent 974baebfe9
commit 47390f6757

View File

@@ -280,7 +280,7 @@ public class PrettyPrintVisitor implements Visitor<Void> {
@Override
public Void visit(VariableDeclaration e) {
ex.write("let " + e.name);
ex.write("let " + e.name + ": " + e.type.getName());
if (e.expression != null) {
ex.write(" = ");
@@ -338,7 +338,7 @@ public class PrettyPrintVisitor implements Visitor<Void> {
ex.write(":");
ex.write(param.type.getName());
}
ex.write(") ");
ex.write("): " + e.type.getName() + " ");
e.block.welcome(this);
return null;
}