Fixes #1238. @antlr/antlr-targets might want to tweak their targets.

This commit is contained in:
parrt 2016-11-25 13:01:07 -08:00
parent 3506dcef1d
commit c695ed25e9
1 changed files with 6 additions and 7 deletions

View File

@ -456,18 +456,17 @@ public class BufferedTokenStream implements TokenStream {
@Override
public String getText() {
lazyInit();
fill();
return getText(Interval.of(0,size()-1));
}
@Override
public String getText(Interval interval) {
@Override
public String getText(Interval interval) {
lazyInit();
fill();
int start = interval.a;
int stop = interval.b;
if ( start<0 || stop<0 ) return "";
lazyInit();
if ( start<0 || stop<0 ) return "";
lazyInit();
if ( stop>=tokens.size() ) stop = tokens.size()-1;
StringBuilder buf = new StringBuilder();