diff options
-rw-r--r-- | src/parser/antlr_input.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index fc03a2903..300b181a6 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -159,8 +159,12 @@ void AntlrInput::lexerError(pANTLR3_BASE_RECOGNIZER recognizer) { AntlrInput *input = (AntlrInput*) parser->getInput(); AlwaysAssert(input!=NULL); - // Call the error display routine - input->parseError("Error finding next token."); + /* Call the error display routine *if* there's not already a + * parse error pending. If a parser error is pending, this + * error is probably less important, so we just drop it. */ + if( input->d_parser->rec->state->error == ANTLR3_FALSE ) { + input->parseError("Error finding next token."); + } } void AntlrInput::parseError(const std::string& message) |