You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2017/04/11 01:38:23 UTC
[47/50] groovy git commit: Support more expressions span rows
Support more expressions span rows
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/d3fde8da
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/d3fde8da
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/d3fde8da
Branch: refs/heads/master
Commit: d3fde8da1308f95fcd9644c626fa01e21dbf2a94
Parents: 7eab98e
Author: sunlan <su...@apache.org>
Authored: Mon Apr 10 16:16:52 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Mon Apr 10 16:16:52 2017 +0800
----------------------------------------------------------------------
.../org/apache/groovy/parser/antlr4/GroovyParser.g4 | 2 +-
.../src/test/resources/core/Expression_23x.groovy | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/groovy/blob/d3fde8da/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 992b63f..ab1241d 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
@@ -823,7 +823,7 @@ expression
| op=(INC | DEC | ADD | SUB) expression #unaryAddExprAlt
// multiplication/division/modulo (level 4)
- | left=expression op=(MUL | DIV | MOD) nls right=expression #multiplicativeExprAlt
+ | left=expression nls op=(MUL | DIV | MOD) nls right=expression #multiplicativeExprAlt
// binary addition/subtraction (level 5)
| left=expression op=(ADD | SUB) nls right=expression #additiveExprAlt
http://git-wip-us.apache.org/repos/asf/groovy/blob/d3fde8da/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
index b87b58d..ab7f763 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
@@ -81,3 +81,17 @@ assert true
||
true
+
+def z =
+ 9
+ /
+ 3
+ *
+ 2
+assert 6 == z
+
+def r =
+ 3
+ %
+ 2
+assert 1 == r
\ No newline at end of file