groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [1/2] groovy git commit: Make non-static inner class creator span rows
Date Wed, 04 Jul 2018 02:32:16 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X bb0a50a4c -> 7a1f71157


Make non-static inner class creator span rows

(cherry picked from commit 8125e18)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 1de196c71adde1413e0d0623003b3db361dfdd8f
Parents: bb0a50a
Author: sunlan <sunlan@apache.org>
Authored: Wed Jul 4 08:09:34 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Wed Jul 4 10:31:59 2018 +0800

----------------------------------------------------------------------
 src/antlr/GroovyParser.g4                                     | 2 +-
 .../src/test/resources/core/NonStaticClass_01x.groovy         | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/1de196c7/src/antlr/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index 3615531..879bb50 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -984,7 +984,7 @@ pathElement returns [int t]
         namePart
         { $t = 1; }
     |
-        DOT nls NEW creator[1]
+        nls DOT nls NEW creator[1]
         { $t = 6; }
     |   arguments
         { $t = 2; }

http://git-wip-us.apache.org/repos/asf/groovy/blob/1de196c7/subprojects/parser-antlr4/src/test/resources/core/NonStaticClass_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/NonStaticClass_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/NonStaticClass_01x.groovy
index 4b70e29..fdb9e08 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/NonStaticClass_01x.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/NonStaticClass_01x.groovy
@@ -16,6 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 public class Y {
     public class X {
         def name
@@ -52,6 +53,11 @@ public class Y {
                 new X('Daniel')
                                 .getName()
     }
+    public static String getXName4() {
+        return createY()
+                .new X('Daniel')
+                .getName()
+    }
 }
 
 assert 'Daniel' == Y.createX(new Y()).name
@@ -59,3 +65,4 @@ assert 'Daniel' == Y.createX().name
 assert 'Daniel' == Y.getXName()
 assert 'Daniel' == Y.getXName2()
 assert 'Daniel' == Y.getXName3()
+assert 'Daniel' == Y.getXName4()


Mime
View raw message