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/GROOVY_2_6_X f408749ad -> 6a198673e


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

(cherry picked from commit 5830d0d)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 6a198673e4db9aaae026a58da61c792b4c5f835a
Parents: f408749
Author: danielsun1106 <[hidden email]>
Authored: Sat Apr 14 21:45:32 2018 +0800
Committer: danielsun1106 <[hidden email]>
Committed: Sat Apr 14 21:46:23 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/6a198673/src/antlr/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index 1d29495..3615531 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -284,7 +284,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/6a198673/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;}