Repository: groovy
Updated Branches:
  refs/heads/parrot e553c91f4 -> 956582d7f


Minor refactoring


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

Branch: refs/heads/parrot
Commit: 956582d7f8a464b07b610bb7f6976b1e665ee299
Parents: e553c91
Author: sunlan <sun...@apache.org>
Authored: Tue Jan 24 21:27:10 2017 +0800
Committer: sunlan <sun...@apache.org>
Committed: Tue Jan 24 21:27:10 2017 +0800

----------------------------------------------------------------------
 .../org/apache/groovy/parser/antlr4/GroovyParser.g4      | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/956582d7/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
----------------------------------------------------------------------
diff --git 
a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
 
b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
index db105c9..9541598 100644
--- 
a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
+++ 
b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
@@ -124,8 +124,7 @@ options {
 
 // starting point for parsing a groovy file
 compilationUnit
-    :
-        nls
+    :   nls
         (packageDeclaration (sep | EOF))? (statement (sep | EOF))* EOF
     ;
 
@@ -1083,9 +1082,11 @@ mapEntryLabel
     ;
 
 creator
-    :   createdName nls arguments anonymousInnerClassDeclaration[0]?
-    |   createdName (LBRACK expression RBRACK)+ (b+=LBRACK RBRACK)*
-    |   createdName (b+=LBRACK RBRACK)+ arrayInitializer
+    :   createdName
+        (   nls arguments anonymousInnerClassDeclaration[0]?
+        |   (LBRACK expression RBRACK)+ (b+=LBRACK RBRACK)*
+        |   (b+=LBRACK RBRACK)+ arrayInitializer
+        )
     ;
 
 arrayInitializer

Reply via email to