Repository: groovy Updated Branches: refs/heads/GROOVY_2_6_X 7effa9cb6 -> 63c975614
Provide more accurate node position of unmatched parentheses Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/63c97561 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/63c97561 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/63c97561 Branch: refs/heads/GROOVY_2_6_X Commit: 63c97561457b08688d390762a1bea999d6c1faaf Parents: 7effa9c Author: sunlan <[email protected]> Authored: Tue Aug 29 01:18:04 2017 +0800 Committer: sunlan <[email protected]> Committed: Tue Aug 29 01:18:04 2017 +0800 ---------------------------------------------------------------------- src/main/antlr/GroovyLexer.g4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/63c97561/src/main/antlr/GroovyLexer.g4 ---------------------------------------------------------------------- diff --git a/src/main/antlr/GroovyLexer.g4 b/src/main/antlr/GroovyLexer.g4 index 3c9b03a..6c8fd33 100644 --- a/src/main/antlr/GroovyLexer.g4 +++ b/src/main/antlr/GroovyLexer.g4 @@ -145,7 +145,7 @@ options { private final Deque<Paren> parenStack = new ArrayDeque<>(32); private void enterParen() { - parenStack.push(new Paren(getText(), this.lastTokenType, getLine(), getCharPositionInLine() + 1)); + parenStack.push(new Paren(getText(), this.lastTokenType, getLine(), getCharPositionInLine())); } private void exitParen() { Paren paren = parenStack.peek(); @@ -153,7 +153,7 @@ options { require(null != paren, "Too many '" + text + "'"); require(text.equals(PAREN_MAP.get(paren.getText())), - "'" + paren.getText() + "'" + new PositionInfo(paren.getLine(), paren.getColumn()) + " can not match '" + text + "'"); + "'" + paren.getText() + "'" + new PositionInfo(paren.getLine(), paren.getColumn()) + " can not match '" + text + "'", -1); parenStack.pop(); }
