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 2017/08/28 16:09:52 UTC

[2/2] groovy git commit: Refine the error alternative of right parenthesis to trade off better performance and better message

Refine the error alternative of right parenthesis to trade off better performance and better message


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 7effa9cb652b65da0969ac78ac49bf806b4d2b67
Parents: 3520ce3
Author: sunlan <su...@apache.org>
Authored: Tue Aug 29 00:08:40 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Tue Aug 29 00:08:40 2017 +0800

----------------------------------------------------------------------
 src/main/antlr/GroovyParser.g4 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7effa9cb/src/main/antlr/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/src/main/antlr/GroovyParser.g4 b/src/main/antlr/GroovyParser.g4
index dcda653..7320879 100644
--- a/src/main/antlr/GroovyParser.g4
+++ b/src/main/antlr/GroovyParser.g4
@@ -1283,8 +1283,9 @@ keywords
 rparen
     :   RPAREN
     |
-        // !!!Error Alternatives, impact the performance of parsing!!!
-        { require(false, "Missing ')'"); }
+        // !!!Error Alternatives
+        ~LPAREN
+        { require(false, "Missing ')'", -1); }
     ;
 
 nls