I'm getting:
line n:m required (...)+ loop did not match anything at character u'#'
But the parser finishes with 0 = parser.getNumberOfSyntaxErrors()
, and produces an AST that is correct. Further checks confirm that the error message is being printed by the lexer which throws an antlr3.exceptions.EarlyExitException
that somehow never reaches the parser.
The lexical rule that should match at that point is:
LOCALVAR
:
'#' NAME_CHAR+
;
And the point of failure in the input reads #I)
.
Why doe the lexing and the parsing succeed? Why the message on valid input?
lexer.getNumberOfSyntaxErrors()
. Maybe the lexer recovers as Bart suggests, but continues to count it as an error. – user1201210