lib/jison/jison.js
function locateNearestErrorRecoveryRule(state) {
            var stack_probe = stack.length - 1;
            var depth = 0;

            // try to recover from error
            for(;;) {
                // check for error recovery rule in this state
                if ((TERROR.toString()) in table[state]) {
                    return depth;
                }
                if (state === 0 || stack_probe < 2) {
                    return false; // No suitable error recovery rule available.
                }
                stack_probe -= 2; // popStack(1): [symbol, action]
                state = stack[stack_probe];
                ++depth;
            }
        }
function locateNearestErrorRecoveryRule(state) {
            var stack_probe = stack.length - 1;
            var depth = 0;

            // try to recover from error
            for(;;) {
                // check for error recovery rule in this state
                if ((TERROR.toString()) in table[state]) {
                    return depth;
                }
                if (state === 0 || stack_probe < 2) {
                    return false; // No suitable error recovery rule available.
                }
                stack_probe -= 2; // popStack(1): [symbol, action]
                state = stack[stack_probe];
                ++depth;
            }
        }
function locateNearestErrorRecoveryRule ( state ) { var stack_probe = stack . length - 1 ; var depth = 0 ; // try to recover from error for ( ; ; ) { // check for error recovery rule in this state if ( ( TERROR . toString ( ) ) in table [ state ] ) { return depth ; } if ( state === 0 || stack_probe < 2 ) { return false ; // No suitable error recovery rule available. } stack_probe -= 2 ; // popStack(1): [symbol, action] state = stack [ stack_probe ] ; ++ depth ; } }
Return the rule stack depth where the nearest error rule can be found. Return FALSE when no error recovery rule was found. we have no rules now
Return the rule stack depth where the nearest error rule can be found . Return FALSE when no error recovery rule was found . we have no rules now