Fix AST visitor for for loops and comprehensions.
RELNOTES: None.
@@ -66,18 +66,17 @@ public class SyntaxTreeVisitor {
public void visit(@SuppressWarnings("unused") Identifier node) {}
public void visit(AbstractComprehension node) {
- visitAll(node.getOutputExpressions());
-
for (ListComprehension.Clause clause : node.getClauses()) {
if (clause.getLValue() != null) {
visit(clause.getLValue());
}
visit(clause.getExpression());
}
+ visitAll(node.getOutputExpressions());
}
public void visit(ForStatement node) {
- visit(node.getVariable().getExpression());
+ visit(node.getVariable());
visit(node.getCollection());
visitAll(node.getBlock());
}
