Repository: groovy Updated Branches: refs/heads/master 0763245b0 -> 77abe22b9
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/77abe22b Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/77abe22b Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/77abe22b Branch: refs/heads/master Commit: 77abe22b94d7525aec05d3d087a10f402ae5d3e4 Parents: 0763245 Author: sunlan <[email protected]> Authored: Tue Aug 29 01:18:04 2017 +0800 Committer: sunlan <[email protected]> Committed: Tue Aug 29 01:19:15 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/77abe22b/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(); }
