groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] branch GROOVY_2_5_X updated: set source position
Date Sat, 25 May 2019 06:47:36 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_2_5_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_2_5_X by this push:
     new 5ae4089  set source position
5ae4089 is described below

commit 5ae40890a7f64689083eda39c0b57d5040eed6de
Author: Paul King <paulk@asert.com.au>
AuthorDate: Sat May 25 16:42:22 2019 +1000

    set source position
---
 .../transform/sc/transformers/VariableExpressionTransformer.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
b/src/main/java/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
index b908425..6e490c1 100644
--- a/src/main/java/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
+++ b/src/main/java/org/codehaus/groovy/transform/sc/transformers/VariableExpressionTransformer.java
@@ -46,13 +46,13 @@ public class VariableExpressionTransformer {
 
     private static Expression tryTransformDelegateToProperty(VariableExpression expr) {
         // we need to transform variable expressions that go to a delegate
-        // to a property expression, as ACG would loose the information
-        // in processClassVariable before it reaches any makeCall, that could
-        // handle it
+        // to a property expression, as ACG would lose the information in
+        // processClassVariable before it reaches any makeCall, that could handle it
         Object val = expr.getNodeMetaData(StaticTypesMarker.IMPLICIT_RECEIVER);
         if (val == null) return null;
         // TODO handle the owner and delegate cases better for nested scenarios and potentially
remove the need for the implicit this case
         VariableExpression receiver = new VariableExpression("owner".equals(val) ? (String)
val : "delegate".equals(val) ? (String) val : "this");
+        receiver.setSourcePosition(expr);
         PropertyExpression pexp = new PropertyExpression(receiver, expr.getName());
         pexp.copyNodeMetaData(expr);
         pexp.setImplicitThis(true);


Mime
View raw message