Pull.next.go: def of emerging-ezjson@1.3.0.0 Import: import emerging-ezjson@1.3.0.0/src/pull.bend as Pull Lines 1451-1536 of emerging-ezjson@1.3.0.0/src/pull.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&start_line=1451&end_line=1536 import Base import emerging-ezjson@1.3.0.0/src/lex.bend as Lex # one character, between events. A plain word is one tail loop. A finished # event returns; everything else tail-calls on the shorter suffix. A string # character and a bracket are not handed to the step twice, so a long row or # a long array moves the suffix instead of keeping it def next.go(fuel: Nat, txt: String, st: St) -> Out: match fuel txt st: case n any S{MDone{stop, saved}, stack, goal, done, bad}: Fin{(stop, Cur{saved, stack, done, bad})} case n txt S{MRest{stop}, stack, goal, done, bad}: Fin{(stop, Cur{txt, stack, done, bad})} case 0n any S{mode, stack, goal, done, bad}: More{any, S{mode, stack, goal, done, bad}} case 1n+left any S{MJump{rest, mode}, stack, goal, done, bad}: next.go(left, rest, S{mode, stack, goal, done, bad}) case 1n+left SNil{} S{MQuote{}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{ch, tl} S{MQuote{}, stack, goal, done, True{}}: next.go(1n+left, tl, err.st(goal)) case 1n+left SCon{ch, +tl} S{MQuote{}, stack, goal, done, False{}}: next.go(1n+left, tl, quote.first(ch, tl, stack, goal, done)) case 1n+left SNil{} S{MIdle{}, stack, goal, done, bad}: Fin{idle.eof(stack, goal, done, bad)} case 1n+left SCon{ch, tl} S{MIdle{}, stack, goal, done, True{}}: next.go(1n+left, tl, err.st(goal)) case 1n+left SCon{ch, tl} S{MIdle{}, stack, goal, done, False{}}: next.go(1n+left, tl, look.plan(ch, stack, goal, done, Lex.classify(ch))) case 1n+left txt S{MWord{buf, nn, num}, stack, goal, done, bad}: next.go(left, "", word.burst(txt, buf, nn, num, stack, goal, bad)) case 1n+left SNil{} S{MSpan{cut, nn}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{ch, tl} S{MSpan{cut, nn}, stack, goal, done, True{}}: next.go(1n+left, tl, err.st(goal)) case 1n+left SCon{ch, tl} S{MSpan{cut, nn}, stack, goal, done, False{}}: next.go(1n+left, tl, span.advance(span.kind.of(ch), cut, nn, stack, goal, done)) case 1n+left SNil{} S{MCopy{buf}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, +tl} S{MCopy{buf}, stack, goal, done, bad}: next.go(1n+left, tl, copy.hit(ch, tl, buf, stack, goal, done, bad, Lex.classify(ch), U32.is_lt(Char.to_u32(ch), 32))) case 1n+left SNil{} S{MEsc{buf}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, +tl} S{MEsc{buf}, stack, goal, done, bad}: next.go(1n+left, tl, esc.hit(ch, tl, buf, stack, goal, done, bad)) case 1n+left SNil{} S{MUni{left2, acc, buf}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, +tl} S{MUni{left2, acc, buf}, stack, goal, done, bad}: next.go(1n+left, tl, uni.hit(ch, tl, left2, acc, buf, stack, goal, done, bad)) case 1n+left SNil{} S{MHi{hi, buf}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{ch, tl} S{MHi{hi, buf}, stack, goal, done, bad}: next.go(1n+left, tl, hi.hit(tl, hi, buf, stack, goal, done, bad, Lex.classify(ch))) case 1n+left SNil{} S{MHiEsc{hi, buf}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, tl} S{MHiEsc{hi, buf}, stack, goal, done, bad}: next.go(1n+left, tl, hiesc.hit(ch, tl, hi, buf, stack, goal, done, bad)) case 1n+left SNil{} S{MLo{left2, acc, hi, buf}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, +tl} S{MLo{left2, acc, hi, buf}, stack, goal, done, bad}: next.go(1n+left, tl, lo.hit(ch, tl, left2, acc, hi, buf, stack, goal, done, bad)) case 1n+left SNil{} S{MSkStr{}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{ch, tl} S{MSkStr{}, stack, goal, done, True{}}: next.go(1n+left, tl, err.st(goal)) case 1n+left SCon{ch, tl} S{MSkStr{}, stack, goal, done, False{}}: next.go(1n+left, tl, sk.advance(span.kind.of(ch), stack, goal, done)) case 1n+left SNil{} S{MSkEsc{}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, tl} S{MSkEsc{}, stack, goal, done, bad}: next.go(1n+left, tl, sk.esc(ch, tl, stack, goal, done, bad)) case 1n+left SNil{} S{MSkUni{left2, acc}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, tl} S{MSkUni{left2, acc}, stack, goal, done, bad}: next.go(1n+left, tl, sk.uni(ch, tl, left2, acc, stack, goal, done, bad)) case 1n+left SNil{} S{MSkHi{hi}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{ch, tl} S{MSkHi{hi}, stack, goal, done, bad}: next.go(1n+left, tl, sk.hi(stack, goal, done, hi, Lex.classify(ch))) case 1n+left SNil{} S{MSkHiEsc{hi}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, tl} S{MSkHiEsc{hi}, stack, goal, done, bad}: next.go(1n+left, tl, sk.hiesc(stack, goal, done, hi, U32.is_eq(Char.to_u32(ch), 117))) case 1n+left SNil{} S{MSkLo{left2, acc, hi}, stack, goal, done, bad}: Fin{bad.cur()} case 1n+left SCon{+ch, tl} S{MSkLo{left2, acc, hi}, stack, goal, done, bad}: next.go(1n+left, tl, sk.lo.go(ch, tl, left2, acc, hi, stack, goal, done, Lex.hex.ok(Char.to_u32(ch)))) Uses (33): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char.to_u32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=classify https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/lex.bend&name=hex.ok https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=Cur https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=Mode https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=Out https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=St https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=bad.cur https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=copy.hit https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=err.st https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=esc.hit https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=hi.hit https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=hiesc.hit https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=idle.eof https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=lo.hit https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=look.plan https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=quote.first https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=sk.advance https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=sk.esc https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=sk.hi https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=sk.hiesc https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=sk.lo.go https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=sk.uni https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=span.advance https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=span.kind.of https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=uni.hit https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/pull.bend&name=word.burst