def parse.loop

mylsm-lsm-store@0.6.0.1 · src/Manifest.bend:438

import mylsm-lsm-store@0.6.0.1/src/Manifest.bend as Manifest
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

438def parse.loop(fuel: Nat, transition: ParseTransition) -> Bytes.Cursor & Maybe<&2, Manifest>:
439  match fuel:
440    case 0n:
441      parse.loop.exhausted(transition)
442    case 1n+rest:
443      match transition:
444        case Reject{cursor}:
445          (cursor, None{})
446        case Finish{cursor, levels}:
447          (cursor, Some{M{levels}})
448        case Continue{state, input}:
449          parse.loop(rest, parse.step.state(state, input))

Uses (9)

Used by (1)