Fix ANTLRInputStream cannot seek to end of input
This commit is contained in:
parent
5c80db61ea
commit
715fe67fce
|
@ -216,8 +216,9 @@ public class ANTLRInputStream implements CharStream {
|
|||
p = index; // just jump; don't update stream state (line, ...)
|
||||
return;
|
||||
}
|
||||
// seek forward, consume until p hits index
|
||||
while ( p<index && index<n ) {
|
||||
// seek forward, consume until p hits index or n (whichever comes first)
|
||||
index = Math.min(index, n);
|
||||
while ( p<index ) {
|
||||
consume();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue