You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by cc...@apache.org on 2015/10/07 21:26:39 UTC

[19/37] incubator-groovy git commit: ASTMatcher: Fix visitListExpression implentation

ASTMatcher: Fix visitListExpression implentation


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/817bbef3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/817bbef3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/817bbef3

Branch: refs/heads/master
Commit: 817bbef37672228eefe6c93fd557613b51686f27
Parents: bac61a1
Author: Cedric Champeau <ce...@gmail.com>
Authored: Fri Oct 17 13:10:44 2014 +0200
Committer: Sergei Egorov <bs...@gmail.com>
Committed: Mon Sep 28 14:33:10 2015 +0300

----------------------------------------------------------------------
 .../codehaus/groovy/macro/matcher/ASTMatcher.groovy    | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/817bbef3/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/matcher/ASTMatcher.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/matcher/ASTMatcher.groovy b/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/matcher/ASTMatcher.groovy
index 9158c32..7b5262c 100644
--- a/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/matcher/ASTMatcher.groovy
+++ b/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/matcher/ASTMatcher.groovy
@@ -815,17 +815,8 @@ class ASTMatcher extends ClassCodeVisitorSupport {
         def iter = currentExprs.iterator()
         for (Expression expression : list) {
             def next = iter.next()
-            if (expression instanceof SpreadExpression) {
-                doWithNode(SpreadExpression, next) {
-                    Expression spread = ((SpreadExpression) expression).getExpression()
-                    doWithNode(Expression, ((SpreadExpression) current).expression) {
-                        spread.visit(this)
-                    }
-                }
-            } else {
-                doWithNode(Expression, next) {
-                    expression.visit(this)
-                }
+            doWithNode(expression.class, next) {
+                expression.visit(this)
             }
         }
     }