From 1d5c4862e136419ab1ed3fcf8d8edaa0ee5fda10 Mon Sep 17 00:00:00 2001 From: Geno <48206120+gabrielegenovese@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:21:12 +0200 Subject: Update src/ast/Python3VisitorImpl.java suggested by santo Co-authored-by: Santo Cariotti --- src/ast/Python3VisitorImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ast/Python3VisitorImpl.java b/src/ast/Python3VisitorImpl.java index bef75cf..42e2537 100644 --- a/src/ast/Python3VisitorImpl.java +++ b/src/ast/Python3VisitorImpl.java @@ -569,11 +569,10 @@ public class Python3VisitorImpl extends Python3ParserBaseVisitor { // TODO: Implement comp_if // Node iter = visit(ctx.comp_if()); Comp_forContext cfc = ctx.comp_for(); + Node forNode = null; if (cfc != null) { - Node forNode = visit(ctx.comp_for()); - return new CompIterNode(forNode); - + forNode = visit(ctx.comp_for()); } - return new CompIterNode(null); + return new CompIterNode(forNode); } } -- cgit v1.2.3-18-g5258