()
| 80126 | // stative ---------------------------- |
| 80127 | |
| 80128 | function stative() { |
| 80129 | var steps = [].slice.call(arguments) |
| 80130 | , step |
| 80131 | , result |
| 80132 | |
| 80133 | return function() { |
| 80134 | var current = state[0] |
| 80135 | |
| 80136 | current.stage || (current.stage = 0) |
| 80137 | |
| 80138 | step = steps[current.stage] |
| 80139 | if(!step) return unexpected('parser in undefined state!') |
| 80140 | |
| 80141 | result = step() |
| 80142 | |
| 80143 | if(result === Advance) return ++current.stage |
| 80144 | if(result === undefined) return |
| 80145 | current.stage = result |
| 80146 | } |
| 80147 | } |
| 80148 | |
| 80149 | function advance(op, t) { |
| 80150 | t = t || 'operator' |
no test coverage detected