summaryrefslogtreecommitdiff
path: root/src/parser/antlr_input.h
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2011-04-18 03:10:55 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2011-04-18 03:10:55 +0000
commit7d281fba79b1c9f3ae646d3371a0e52e2efd3bba (patch)
treee76c7b2b3234c71aa9f5a2461b916a6e014bebb7 /src/parser/antlr_input.h
parentca0fb38ee6a8aa390e6566d421a9ade7d0fb67d2 (diff)
Fixing output for EOF token in parser errors
Diffstat (limited to 'src/parser/antlr_input.h')
-rw-r--r--src/parser/antlr_input.h4
1 files changed, 4 insertions, 0 deletions
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 "<<EOF>>";
+ }
+
ANTLR3_MARKER start = token->getStartIndex(token);
ANTLR3_MARKER end = token->getStopIndex(token);
/* start and end are boundary pointers. The text is a string
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback