diff options
Diffstat (limited to 'src/parser/antlr_input_imports.cpp')
-rw-r--r-- | src/parser/antlr_input_imports.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parser/antlr_input_imports.cpp b/src/parser/antlr_input_imports.cpp index 7c879f5bc..d25d7b66b 100644 --- a/src/parser/antlr_input_imports.cpp +++ b/src/parser/antlr_input_imports.cpp @@ -114,6 +114,8 @@ void AntlrInput::reportError(pANTLR3_BASE_RECOGNIZER recognizer) { } else { if(ex->expecting == ANTLR3_TOKEN_EOF) { ss << "Missing end of file marker."; + } else if( ex->expecting == 0 ) { + ss << "Unexpected token: '" << tokenText((pANTLR3_COMMON_TOKEN)ex->token) << "'."; } else { ss << "Missing " << tokenNames[ex->expecting] << "."; } @@ -147,6 +149,8 @@ void AntlrInput::reportError(pANTLR3_BASE_RECOGNIZER recognizer) { } else { if(ex->expecting == ANTLR3_TOKEN_EOF) { ss << "Expected end of file."; + } else if( ex->expecting == 0 ) { + ss << "Unexpected token: '" << tokenText((pANTLR3_COMMON_TOKEN)ex->token) << "'."; } else { ss << "Expected " << tokenNames[ex->expecting] << "."; } |