This commit is contained in:
Eric Vergnaud 2016-12-04 18:58:49 +08:00
parent 67a93b3f36
commit 5ce735f56f
1 changed files with 2 additions and 12 deletions

View File

@ -1278,8 +1278,6 @@ ParserATNSimulator.prototype.closureCheckingStopState = function(config, configs
this.closure_(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon);
};
var drops = [];
var odds = 0;
// Do the actual work of walking epsilon edges//
ParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEofAsEpsilon) {
@ -1291,16 +1289,8 @@ ParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, c
// both epsilon transitions and non-epsilon transitions.
}
for(var i = 0;i<p.transitions.length; i++) {
if(i==0) {
if(drops.length==100)
drops = [];
if (this.canDropLoopEntryEdgeInLeftRecursiveRule(config)) {
drops.push(odds);
odds = odds + 1;
if(i==0 && this.canDropLoopEntryEdgeInLeftRecursiveRule(config))
continue;
} else
odds = odds + 1;
}
var t = p.transitions[i];
var continueCollecting = collectPredicates && !(t instanceof ActionTransition);