groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [40/50] [abbrv] groovy git commit: remove InvocationWriter's usage from groovy-macro module
Date Fri, 07 Apr 2017 13:31:23 GMT
remove InvocationWriter's usage from groovy-macro module


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

Branch: refs/heads/parrot
Commit: b58da0fa95335e6c996474a9eb10edfaeaf3d73d
Parents: e0655eb
Author: Sergei Egorov <sergei.egorov@zeroturnaround.com>
Authored: Tue Mar 28 16:39:09 2017 +0300
Committer: Sergei Egorov <sergei.egorov@zeroturnaround.com>
Committed: Tue Mar 28 16:39:09 2017 +0300

----------------------------------------------------------------------
 .../groovy/macro/transform/MacroCallTransformingVisitor.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/b58da0fa/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroCallTransformingVisitor.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroCallTransformingVisitor.java
b/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroCallTransformingVisitor.java
index 1afbeb7..733d666 100644
--- a/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroCallTransformingVisitor.java
+++ b/subprojects/groovy-macro/src/main/groovy/org/codehaus/groovy/macro/transform/MacroCallTransformingVisitor.java
@@ -20,7 +20,6 @@ package org.codehaus.groovy.macro.transform;
 
 import org.codehaus.groovy.ast.*;
 import org.codehaus.groovy.ast.expr.*;
-import org.codehaus.groovy.classgen.asm.InvocationWriter;
 import org.codehaus.groovy.control.CompilationUnit;
 import org.codehaus.groovy.control.SourceUnit;
 import org.codehaus.groovy.macro.runtime.MacroContext;
@@ -71,7 +70,12 @@ class MacroCallTransformingVisitor extends ClassCodeVisitorSupport {
     public void visitMethodCallExpression(MethodCallExpression call) {
         super.visitMethodCallExpression(call);
 
-        List<Expression> callArguments = InvocationWriter.makeArgumentList(call.getArguments()).getExpressions();
+        final List<Expression> callArguments;
+        if (call.getArguments() instanceof TupleExpression) {
+            callArguments = ((TupleExpression) call.getArguments()).getExpressions();
+        } else {
+            callArguments = Collections.singletonList(call.getArguments());
+        }
 
         List<MethodNode> macroMethods = findMacroMethods(call.getMethodAsString(),
callArguments);
 


Mime
View raw message