lexer getText() included lookahead char, which it shouldn't.

This commit is contained in:
Terence Parr 2012-05-23 14:09:32 -07:00
parent cd82465830
commit e737653b4f
1 changed files with 3 additions and 2 deletions

View File

@ -716,10 +716,11 @@ public class LexerATNSimulator extends ATNSimulator {
return dfa[mode];
}
/** Get the text of the current token */
/** Get the text of the current token. */
@NotNull
public String getText(@NotNull CharStream input) {
return input.getText(Interval.of(startIndex, input.index()));
// index is first lookahead char, don't include.
return input.getText(Interval.of(startIndex, input.index()-1));
}
public int getLine() {