MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / stative

Function stative

MathBox/mathbox-bundle.js:80128–80147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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'

Callers 3

parse_stmtlistFunction · 0.70
parse_declFunction · 0.70
setup_stative_parsersFunction · 0.70

Calls 1

unexpectedFunction · 0.70

Tested by

no test coverage detected