def runb
bend-kit-json@0.7.0.0 · json.bend:694
import bend-kit-json@0.7.0.0/json.bend as Json
import Base
694
695def runb(+fuel: Nat, r: Array<U32> & Sb & U32, +len: U32, +strict: Bool, +cap: U32) -> Maybe<&1, Val>:
696 match fuel:
697 case 0n:
698 None{}
699 case 1n+f:
700 (a, sb, depth) = r
701 match sb:
702 case BOk{v}:
703 Some{v}
704 case BFail{}:
705 None{}
706 case BValue{+i, stack}:
707 runb(f, level.r(depth, value.r(len, stack, run(~is_ws, f, a, len, i))), len, strict, cap)
708 case BFirst{+i, open, stack}:
709 runb(f, first.limit(cap, depth, open, stack, run(~is_ws, f, a, len, i)), len, strict, cap)
710 case BKey{+i, stack}:
711 runb(f, level.r(depth, key.r(stack, run(~is_ws, f, a, len, i))), len, strict, cap)
712 case BColon{k, +i, stack}:
713 runb(f, level.r(depth, colon.r(k, stack, run(~is_ws, f, a, len, i))), len, strict, cap)
714 case BStr{+i, +s, k, stack}:
715 runb(f, level.r(depth, str.r(strict, len, s, k, stack, run(~plain, f, a, len, i))), len, strict, cap)
716 case BEsc{+i, acc, k, stack}:
717 runb(f, level.r(depth, esc.r(strict, len, i, acc, k, stack, run(~plain, f, a, len, i))), len, strict, cap)
718 case BNum{+i, +s, +st, stack}:
719 runb(f, level.r(depth, num.r(s, st, stack, num.run(U32.is_eq(st, 3) || U32.is_eq(st, 5) || U32.is_eq(st, 8), f, a, len, i))), len, strict, cap)
720 case BAfter{v, +i, stack}:
721 runb(f, (a, after.b(v, i, stack), depth), len, strict, cap)
722 case BSep{+i, open, stack}:
723 runb(f, sep.r(depth, open, stack, run(~is_ws, f, a, len, i)), len, strict, cap)
724 case BEnd{v, +i}:
725 runb(f, level.r(depth, end.r(v, run(~is_ws, f, a, len, i))), len, strict, cap)