fix #1023: getExpectedTokens() returns out of context tokens on consecutive runs
This commit is contained in:
parent
8abc1106f7
commit
af9e8a1e92
|
@ -269,7 +269,8 @@ DefaultErrorStrategy.prototype.sync = function(recognizer) {
|
|||
case ATNState.PLUS_LOOP_BACK:
|
||||
case ATNState.STAR_LOOP_BACK:
|
||||
this.reportUnwantedToken(recognizer);
|
||||
var expecting = recognizer.getExpectedTokens();
|
||||
var expecting = new IntervalSet();
|
||||
expecting.addSet(recognizer.getExpectedTokens());
|
||||
var whatFollowsLoopIterationOrRule = expecting.addSet(this.getErrorRecoverySet(recognizer));
|
||||
this.consumeUntil(recognizer, whatFollowsLoopIterationOrRule);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue