diff options
Diffstat (limited to 'src/ast/nodes/ExprNode.java')
-rw-r--r-- | src/ast/nodes/ExprNode.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ast/nodes/ExprNode.java b/src/ast/nodes/ExprNode.java index 62b3a94..781cc76 100644 --- a/src/ast/nodes/ExprNode.java +++ b/src/ast/nodes/ExprNode.java @@ -26,6 +26,14 @@ public class ExprNode implements Node { this.trailers = trailers; } + public Node getExpr(int i) { + if (i >= this.exprs.size()) { + return null; + } + + return this.exprs.get(i); + } + public String getId() { if (atom != null) { return ((AtomNode) this.atom).getId(); @@ -67,7 +75,8 @@ public class ExprNode implements Node { int argNumber = trailer.getArgumentNumber(); if (paramNumber != argNumber) { - errors.add(new SemanticError(funName + "() takes " + String.valueOf(paramNumber) + " positional arguments but " + String.valueOf(argNumber) + " were given.")); + errors.add(new SemanticError(funName + "() takes " + String.valueOf(paramNumber) + + " positional arguments but " + String.valueOf(argNumber) + " were given.")); } } } |