groovy git commit: GROOVY-8544: The new parser Parrot does not support enum constants end with semicolon

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

groovy git commit: GROOVY-8544: The new parser Parrot does not support enum constants end with semicolon

Daniel.Sun
Repository: groovy
Updated Branches:
  refs/heads/master 5443e8788 -> 5830d0d4b


GROOVY-8544: The new parser Parrot does not support enum constants end with semicolon


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

Branch: refs/heads/master
Commit: 5830d0d4ba8d0547b61b871c3f1549acb946b6ea
Parents: 5443e87
Author: danielsun1106 <[hidden email]>
Authored: Sat Apr 14 21:45:32 2018 +0800
Committer: danielsun1106 <[hidden email]>
Committed: Sat Apr 14 21:45:32 2018 +0800

----------------------------------------------------------------------
 src/antlr/GroovyParser.g4                             |  2 +-
 .../src/test/resources/core/EnumDeclaration_01.groovy | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/5830d0d4/src/antlr/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index aef9289..77867da 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -251,7 +251,7 @@ classBody[int t]
         (
             /* Only enum can have enum constants */
             { 2 == $t }?
-            enumConstants? nls
+            enumConstants? sep?
         |
 
         )

http://git-wip-us.apache.org/repos/asf/groovy/blob/5830d0d4/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
index ed0f67d..3e733b6 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
@@ -23,6 +23,11 @@ public enum AAAA3 implements A {}
 public enum AAAA4 implements A,B {}
 enum BBBB {A}
 enum CCCC {A, B}
+enum CCCC2 {A, B
+}
+enum CCCC3 {
+    A, B
+}
 enum DDDD {A, B,}
 enum EEEE {
     A,
@@ -59,4 +64,11 @@ enum E3 {
 
 
 
-enum e {}
\ No newline at end of file
+enum e {}
+
+enum Enum1 {
+    A, B;
+}
+enum Enum2 {
+    A, B;}
+enum Enum3 {A, B;}