diff options
Diffstat (limited to 'src/ast/nodes/ForStmtNode.java')
-rw-r--r-- | src/ast/nodes/ForStmtNode.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ast/nodes/ForStmtNode.java b/src/ast/nodes/ForStmtNode.java index 50574f0..507d314 100644 --- a/src/ast/nodes/ForStmtNode.java +++ b/src/ast/nodes/ForStmtNode.java @@ -33,7 +33,7 @@ public class ForStmtNode implements Node { * an atom. */ @Override - public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) { + public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting, FunctionType ft) { ArrayList<SemanticError> errors = new ArrayList<>(); // Save every atom in the expression's list, except the last one @@ -52,8 +52,8 @@ public class ForStmtNode implements Node { // ENHANCE: check that the comp_op is the `in` keyword ST.insert(atomLeft.getId(), atomLeft.typeCheck(), _nesting, ""); - errors.addAll(exprList.checkSemantics(ST, _nesting)); - errors.addAll(block.checkSemantics(ST, _nesting)); + errors.addAll(exprList.checkSemantics(ST, _nesting, ft)); + errors.addAll(block.checkSemantics(ST, _nesting, ft)); return errors; } @@ -63,7 +63,10 @@ public class ForStmtNode implements Node { return new VoidType(); } - // TODO: add code generation for while + /** + * We do not provide the cgen for the `for_stm` because we do not have the + * iterators idea that the real Python has. + */ @Override public String codeGeneration() { return ""; |