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

Function stative

MathBox/mathbox-core.js:33443–33462  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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'

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