()
| 33441 | // stative ---------------------------- |
| 33442 | |
| 33443 | function stative() { |
| 33444 | var steps = [].slice.call(arguments) |
| 33445 | , step |
| 33446 | , result |
| 33447 | |
| 33448 | return function() { |
| 33449 | var current = state[0] |
| 33450 | |
| 33451 | current.stage || (current.stage = 0) |
| 33452 | |
| 33453 | step = steps[current.stage] |
| 33454 | if(!step) return unexpected('parser in undefined state!') |
| 33455 | |
| 33456 | result = step() |
| 33457 | |
| 33458 | if(result === Advance) return ++current.stage |
| 33459 | if(result === undefined) return |
| 33460 | current.stage = result |
| 33461 | } |
| 33462 | } |
| 33463 | |
| 33464 | function advance(op, t) { |
| 33465 | t = t || 'operator' |
no test coverage detected