forked from jasder/antlr
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, ...)
|
p = index; // just jump; don't update stream state (line, ...)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// seek forward, consume until p hits index
|
// seek forward, consume until p hits index or n (whichever comes first)
|
||||||
while ( p<index && index<n ) {
|
index = Math.min(index, n);
|
||||||
|
while ( p<index ) {
|
||||||
consume();
|
consume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue