diff options
author | 2017-08-10 22:15:22 +0200 | |
---|---|---|
committer | 2017-08-11 12:56:33 +0200 | |
commit | d1c59169921d9aa3d066f9694517454221dac089 (patch) | |
tree | 9986347ee992c617be99066105ec6acc44d61edd | |
parent | ff70a288a5a9c521955f02902321857a325d6e44 (diff) |
Fix AST visitor for for loops and comprehensions.
RELNOTES: None.
PiperOrigin-RevId: 164893252
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/syntax/SyntaxTreeVisitor.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SyntaxTreeVisitor.java b/src/main/java/com/google/devtools/build/lib/syntax/SyntaxTreeVisitor.java index c086fe3220..345b4bbe96 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/SyntaxTreeVisitor.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/SyntaxTreeVisitor.java @@ -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()); } |