From 7d281fba79b1c9f3ae646d3371a0e52e2efd3bba Mon Sep 17 00:00:00 2001 From: "Christopher L. Conway" Date: Mon, 18 Apr 2011 03:10:55 +0000 Subject: [PATCH] Fixing output for EOF token in parser errors --- src/parser/antlr_input.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 2f12aea03..c48185f58 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -219,6 +219,10 @@ inline std::string AntlrInput::getUnparsedText() { inline std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { + if( token->type == ANTLR3_TOKEN_EOF ) { + return "<>"; + } + ANTLR3_MARKER start = token->getStartIndex(token); ANTLR3_MARKER end = token->getStopIndex(token); /* start and end are boundary pointers. The text is a string -- 2.30.2