summaryrefslogtreecommitdiff
path: root/src/ast/nodes/ArglistNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/nodes/ArglistNode.java')
-rw-r--r--src/ast/nodes/ArglistNode.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ast/nodes/ArglistNode.java b/src/ast/nodes/ArglistNode.java
index f0c33e1..71bcdce 100644
--- a/src/ast/nodes/ArglistNode.java
+++ b/src/ast/nodes/ArglistNode.java
@@ -19,9 +19,19 @@ public class ArglistNode implements Node {
@Override
public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
ArrayList<SemanticError> errors = new ArrayList<SemanticError>();
-
+
for (var arg : arguments) {
- errors.addAll(arg.checkSemantics(ST, _nesting));
+ ExprNode argExpr = (ExprNode) arg;
+ String argName = argExpr.getId();
+
+ // TODO: check fucking IntType for params
+ // TODO: remove fucking comments
+ if (!ST.top_lookup(argName) && argExpr.typeCheck() instanceof AtomType){
+ // System.out.println(!(this.typeCheck() instanceof IntType) + " " + !ST.top_lookup(this.getId()));
+ errors.add(new SemanticError("'" + argName + "' is not defined."));
+ } else {
+ errors.addAll(arg.checkSemantics(ST, _nesting));
+ }
}
return errors;