fix #1177 (LB(k) stops at index 0) @antlr/antlr-targets might care about this
This commit is contained in:
parent
9ef75603ce
commit
0a7e90fe8e
|
@ -77,7 +77,7 @@ public class CommonTokenStream extends BufferedTokenStream {
|
|||
int i = p;
|
||||
int n = 1;
|
||||
// find k good tokens looking backwards
|
||||
while ( n<=k ) {
|
||||
while ( n<=k && i>0 ) {
|
||||
// skip off-channel tokens
|
||||
i = previousTokenOnChannel(i - 1, channel);
|
||||
n++;
|
||||
|
|
Loading…
Reference in New Issue