From b50c7e99603e9f85d82d700d62c16c4fcef88715 Mon Sep 17 00:00:00 2001 From: Geno <48206120+gabrielegenovese@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:57:56 +0200 Subject: Code generation (#20) Co-authored-by: geno Co-authored-by: Santo Cariotti --- src/ast/nodes/CompForNode.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/ast/nodes/CompForNode.java') diff --git a/src/ast/nodes/CompForNode.java b/src/ast/nodes/CompForNode.java index 405a400..1f51af5 100644 --- a/src/ast/nodes/CompForNode.java +++ b/src/ast/nodes/CompForNode.java @@ -22,13 +22,13 @@ public class CompForNode implements Node { } @Override - public ArrayList checkSemantics(SymbolTable ST, int _nesting) { + public ArrayList checkSemantics(SymbolTable ST, int _nesting, FunctionType ft) { ArrayList errors = new ArrayList<>(); - errors.addAll(exprlist.checkSemantics(ST, _nesting)); - errors.addAll(single_expr.checkSemantics(ST, _nesting)); + errors.addAll(exprlist.checkSemantics(ST, _nesting, ft)); + errors.addAll(single_expr.checkSemantics(ST, _nesting, ft)); if (comp_iter != null) { - errors.addAll(comp_iter.checkSemantics(ST, _nesting)); + errors.addAll(comp_iter.checkSemantics(ST, _nesting, ft)); } return errors; } @@ -38,7 +38,9 @@ public class CompForNode implements Node { return new VoidType(); } - // TODO: add code generation for arglist node + /** + * We do not want to provide the code generation for the for list comprehension. + */ @Override public String codeGeneration() { return ""; -- cgit v1.2.3-18-g5258