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/02/04 01:10:51 UTC
[groovy] 02/03: Tweak `variableDeclaration` rule
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 46f446696cdbb943ce0a5cb20e28873b3f815bda
Author: Sam Harwell <sa...@tunnelvisionlabs.com>
AuthorDate: Tue Feb 4 05:01:43 2020 +0800
Tweak `variableDeclaration` rule
```
classifiedModifiers[$t]? type variableDeclarators
```
can be written as:
```
( classifiedModifiers[$t] type variableDeclarators
| type variableDeclarators
)
```
(cherry picked from commit bc84072f29d48977b5951d9777f47201ece834b1)
---
src/antlr/GroovyParser.g4 | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/antlr/GroovyParser.g4 b/src/antlr/GroovyParser.g4
index 93d4662..d77c581 100644
--- a/src/antlr/GroovyParser.g4
+++ b/src/antlr/GroovyParser.g4
@@ -592,13 +592,11 @@ classifiedModifiers[int t]
* t 0: local variable declaration; 1: field declaration
*/
variableDeclaration[int t]
-@leftfactor { classifiedModifiers }
: classifiedModifiers[$t]
( type? variableDeclarators
| typeNamePairs nls ASSIGN nls variableInitializer
)
|
- classifiedModifiers[$t]?
type variableDeclarators
;