From 12a36946e89306a3886541be98be6190d07662f4 Mon Sep 17 00:00:00 2001 From: parrt Date: Fri, 12 Jun 2015 12:43:30 -0700 Subject: [PATCH] actually just show text of erroneous token in red in treeviewer. --- runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java b/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java index 9aa1c5afd..f8f68f721 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java +++ b/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java @@ -424,7 +424,7 @@ public class ParserInterpreter extends Parser { Token errToken = getTokenFactory().create(new Pair(tok.getTokenSource(), tok.getTokenSource().getInputStream()), - expectedTokenType, tokenText, + expectedTokenType, tok.getText(), Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop tok.getLine(), tok.getCharPositionInLine()); @@ -434,7 +434,7 @@ public class ParserInterpreter extends Parser { Token tok = e.getOffendingToken(); Token errToken = getTokenFactory().create(new Pair(tok.getTokenSource(), tok.getTokenSource().getInputStream()), - Token.INVALID_TYPE, "", + Token.INVALID_TYPE, tok.getText(), Token.DEFAULT_CHANNEL, -1, -1, // invalid start/stop tok.getLine(), tok.getCharPositionInLine());