groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [17/50] groovy git commit: Minor refactoring
Date Tue, 11 Apr 2017 01:37:53 GMT
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/master
Commit: 956582d7f8a464b07b610bb7f6976b1e665ee299
Parents: e553c91
Author: sunlan <sunlan@apache.org>
Authored: Tue Jan 24 21:27:10 2017 +0800
Committer: sunlan <sunlan@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


Mime
View raw message