You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/01/26 09:23:11 UTC

[groovy] branch GROOVY_3_0_X updated (c31341e -> e9f3321)

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a change to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git.


    from c31341e  Use ubuntu-18.04 to align with the OS version of gradle workflow
     new 60bf042  Tweak `classOrInterfaceModifiers` rule
     new e9f3321  Tweak rules

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/antlr/GroovyParser.g4 | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)


[groovy] 02/02: Tweak rules

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit e9f3321406a3e413bc40ea3c5068ca2856164b08
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jan 26 14:39:25 2020 +0800

    Tweak rules
    
    (cherry picked from commit 4cd3b09760d21238f3864f2a3772922d76220592)
---
 src/antlr/GroovyParser.g4 | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index 3e3a9b9..3107f1c 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -136,11 +136,11 @@ modifier
     ;
 
 modifiersOpt
-    :   modifiers?
+    :   (modifiers nls)?
     ;
 
 modifiers
-    :   (modifier nls)+
+    :   modifier (nls modifier)*
     ;
 
 classOrInterfaceModifiersOpt
@@ -184,11 +184,11 @@ variableModifier
     ;
 
 variableModifiersOpt
-    :   variableModifiers?
+    :   (variableModifiers nls)?
     ;
 
 variableModifiers
-    :   (variableModifier nls)+
+    :   variableModifier (nls variableModifier)*
     ;
 
 typeParameters
@@ -333,7 +333,7 @@ variableInitializer
     ;
 
 variableInitializers
-    :   variableInitializer nls (COMMA nls variableInitializer nls)* nls COMMA?
+    :   variableInitializer (nls COMMA nls variableInitializer)* nls COMMA?
     ;
 
 dims
@@ -532,11 +532,11 @@ blockStatements
 // ANNOTATIONS
 
 annotationsOpt
-    :   (annotation nls)*
+    :   (annotation (nls annotation)* nls)?
     ;
 
 annotation
-    :   AT annotationName ( LPAREN elementValues? rparen )?
+    :   AT annotationName ( LPAREN elementValues? rparen)?
     ;
 
 elementValues
@@ -587,11 +587,11 @@ localVariableDeclaration
     ;
 
 classifiedModifiers[int t]
-    :   { 0 == $t }? variableModifiers
-    |   { 1 == $t }? modifiers
+    :   (   { 0 == $t }? variableModifiers
+        |   { 1 == $t }? modifiers
+        ) nls
     ;
 
-
 /**
  *  t   0: local variable declaration; 1: field declaration
  */
@@ -716,7 +716,7 @@ resource
  *  To handle empty cases at the end, we add switchLabel* to statement.
  */
 switchBlockStatementGroup
-    :   (switchLabel nls)+ blockStatements
+    :   switchLabel (nls switchLabel)* nls blockStatements
     ;
 
 switchLabel


[groovy] 01/02: Tweak `classOrInterfaceModifiers` rule

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 60bf042cbdf42c30989d52832f3a0c0042ccd0dd
Author: Sam Harwell <sa...@tunnelvisionlabs.com>
AuthorDate: Sun Jan 26 13:23:47 2020 +0800

    Tweak `classOrInterfaceModifiers` rule
    
    (cherry picked from commit 28c4e91a5d5634c263b2630669f7b39b73b4aac4)
---
 src/antlr/GroovyParser.g4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index 804f1f9..3e3a9b9 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -144,11 +144,11 @@ modifiers
     ;
 
 classOrInterfaceModifiersOpt
-    :   classOrInterfaceModifiers?
+    :   (classOrInterfaceModifiers nls)?
     ;
 
 classOrInterfaceModifiers
-    :   (classOrInterfaceModifier nls)+
+    :   classOrInterfaceModifier (nls classOrInterfaceModifier)*
     ;
 
 classOrInterfaceModifier