bend-kit-json Releases (10): 0.7.0.0 0x37aacddc1dcb57464b8b5ac6c397bd64 indexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.7.0.0 0.6.1.1 0x040b6c79c72da50288552227f006b061 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.6.1.1 0.6.1.0 0x7bc00b6d7a55fb443b6fda96d93cc00c unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.6.1.0 0.6.0.0 0x8109dcc91c23a3cfb066a5f6c1a3280b unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.6.0.0 0.5.1.0 0xc57af2d86db2e94187b6fb2ac4976fc9 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.5.1.0 0.5.0.2 0x97c67c8e26f890df51d316cdfe3e9ae4 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.5.0.2 0.5.0.1 0x584fc27920487ceab242392391418d7f unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.5.0.1 0.5.0.0 0xcdde0eac97319e908732c0dba1108f3b unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.5.0.0 0.4.0.0 0xc0344463a222d4d3057e74f8fc810bc0 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.4.0.0 0.3.0.0 0xaaa10a97bf5ac6990143da2c863f8a3f unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-json@0.3.0.0 Definitions (140, 1 to 100 shown): Json.Val (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=Val) # Num keeps the number's exact text, so no precision is lost. Obj keeps its # fields in document order, repeated keys included. type Val is Type: Null{} Flag{on: Bool} Num{s: Bytes.Bytes} Str{s: Bytes.Bytes} Arr{xs: List<&1, Val>} Obj{kvs: List<&1, Bytes.Bytes & Val>} Json.Open (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=Open) # An open container: array items so far, object fields so far, or those fields # and the key whose value comes next. Items and fields are reversed. type Open is Type: OArr{xs: List<&1, Val>} OObj{kvs: List<&1, Bytes.Bytes & Val>} OKey{kvs: List<&1, Bytes.Bytes & Val>, key: Bytes.Bytes} Json.W (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=W) # Writer # ------ # Octets being written: the buffer, its size in words, the count so far, and # the word being filled. Bytes enter at the top of w, as in Bytes.from_string. type W is Type: W{buf: Array, cap: U32, n: U32, w: U32} Json.w.room (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.room) # The buffer doubles when word k does not fit. def w.room(grow: Bool, buf: Array, +k: U32) -> Array: Json.w.store (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.store) def w.store(full: Bool, buf: Array, +cap: U32, +n: U32, +w: U32) -> W: Json.w.put (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.put) def w.put(o: W, +b: U32) -> W: Json.w.shrink (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.shrink) def w.shrink(fit: Bool, +n: U32, buf: Array) -> Array: Json.w.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.done) # Stores the last partial word, then copies into the fewest words, as Bytes requires. def w.done(o: W) -> Bytes.Bytes: Json.w.cont (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.cont) def w.cont(+c: U32, +k: Nat) -> U32: Json.w.cp.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.cp.of) def w.cp.of(+n: U32, +c: U32, o: W) -> W: Json.w.cp (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.cp) # One code point in UTF-8. def w.cp(+c: U32, o: W) -> W: Json.w.hex (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.hex) def w.hex(+n: U32) -> U32: Json.w.new (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.new) def w.new() -> W: Json.w.of.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.of.at) def w.of.at(+len: U32, +cap: U32, r: Array & U32) -> W: Json.w.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.of) # A writer that appends to b. def w.of(b: Bytes.Bytes) -> W: Json.w.text (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.text) def w.text(s: String, o: W) -> W: Json.utf8 (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=utf8) # Text, one Char per code point, as UTF-8. def utf8(s: String) -> Bytes.Bytes: Json.digit (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=digit) def digit(+c: U32) -> Bool: Json.num.trans (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.trans) def num.trans(+st: U32, +c: U32) -> U32: Json.num.accepts (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.accepts) def num.accepts(+st: U32) -> Bool: Json.hexd (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=hexd) def hexd(+c: U32) -> U32: Json.is_hi (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=is_hi) def is_hi(+v: U32) -> Bool: Json.is_lo (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=is_lo) def is_lo(+v: U32) -> Bool: Json.esc.simple (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.simple) def esc.simple(+e: U32) -> U32: Json.Sb (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=Sb) type Sb is Type: BValue{i: U32, stack: List<&1, Open>} BFirst{i: U32, open: Open, stack: List<&1, Open>} BKey{i: U32, stack: List<&1, Open>} BColon{key: Bytes.Bytes, i: U32, stack: List<&1, Open>} BStr{i: U32, start: U32, key: Bool, stack: List<&1, Open>} BEsc{i: U32, acc: W, key: Bool, stack: List<&1, Open>} BNum{i: U32, start: U32, st: U32, stack: List<&1, Open>} BAfter{v: Val, i: U32, stack: List<&1, Open>} BSep{i: U32, open: Open, stack: List<&1, Open>} BEnd{v: Val, i: U32} … Json.Cp (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=Cp) type Cp is Data: Cp{c: U32, w: U32} Json.pk.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=pk.if) def pk.if(ok: Bool, a: Array, +i: U32) -> Array & U32: Json.pk (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=pk) # Byte i, or 256 at the end, which no rule accepts. def pk(a: Array, +len: U32, +i: U32) -> Array & U32: Json.is_ws (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=is_ws) def is_ws(+c: U32) -> Bool: Json.plain (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=plain) # A string byte that needs no check: ASCII, not a control, quote or backslash. def plain(+c: U32) -> Bool: Json.pos.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=pos.of) def pos.of(+i: U32, r: Array & U32) -> Array & U32 & U32: Json.pos (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=pos) # The offset i and its byte. def pos(a: Array, +len: U32, +i: U32) -> Array & U32 & U32: Json.run.cls (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=run.cls) def run.cls(~ok: @+c: U32 -> Bool, r: Array & U32) -> Array & U32 & Bool: Json.run.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=run.go) # g bounds the loop; it is the parser's fuel, shared, so no count is built per run. def run.go(~ok: @+c: U32 -> Bool, g: Nat, r: Array & U32 & Bool, +len: U32, +i: U32) -> Array & U32 & U32: Json.run (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=run) # The first offset from i whose byte is not ok, and that byte. def run(~ok: @+c: U32 -> Bool, +g: Nat, a: Array, +len: U32, +i: U32) -> Array & U32 & U32: Json.word.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=word.go) def word.go(w: String, ok: Bool, r: Array & U32, +len: U32, +j: U32) -> Array & Bool: Json.word (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=word) # Do the bytes from j spell w? def word(a: Array, +len: U32, w: String, +j: U32) -> Array & Bool: Json.hex4.b.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=hex4.b.go) def hex4.b.go(n: Nat, r: Array & U32, +len: U32, +j: U32, +acc: U32) -> Array & U32: Json.hex4.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=hex4.b) # Four hex digits from byte j, or 65536 if one is not a hex digit. def hex4.b(a: Array, +len: U32, +j: U32) -> Array & U32: Json.cont (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=cont) def cont(+b: U32) -> Bool: Json.utf8.n (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=utf8.n) # RFC 3629 §4: overlong forms, surrogates, and code points past U+10FFFF are invalid, width 0. def utf8.n(+b0: U32, +b1: U32, +b2: U32, +b3: U32) -> Cp: Json.utf8.b3 (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=utf8.b3) def utf8.b3(+b0: U32, +b1: U32, +b2: U32, r: Array & U32) -> Array & Cp: Json.utf8.b2 (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=utf8.b2) def utf8.b2(+len: U32, +i: U32, +b0: U32, +b1: U32, r: Array & U32) -> Array & Cp: Json.utf8.b1 (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=utf8.b1) def utf8.b1(+len: U32, +i: U32, +b0: U32, r: Array & U32) -> Array & Cp: Json.utf8.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=utf8.at) # The code point whose lead byte b0 is at i. def utf8.at(a: Array, +len: U32, +i: U32, +b0: U32) -> Array & Cp: Json.slice.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=slice.of) def slice.of(+n: U32, r: Array & Array) -> Array & Bytes.Bytes: Json.slice (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=slice) # The n bytes from start, copied. def slice(+n: U32, +start: U32, a: Array) -> Array & Bytes.Bytes: Json.str.b.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.b.done) def str.b.done(key: Bool, s: Bytes.Bytes, +i: U32, stack: List<&1, Open>) -> Sb: Json.esc.b.lone (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.lone) def esc.b.lone(strict: Bool, +i: U32, acc: W, key: Bool, stack: List<&1, Open>) -> Sb: Json.esc.b.lo.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.lo.if) def esc.b.lo.if(ok: Bool, strict: Bool, +i: U32, +hi: U32, +lo: U32, acc: W, key: Bool, stack: List<&1, Open>) -> Sb: Json.esc.b.lo (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.lo) def esc.b.lo(strict: Bool, +i: U32, +hi: U32, acc: W, key: Bool, stack: List<&1, Open>, r: Array & U32) -> Array & Sb: Json.esc.b.pair (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.pair) # A high surrogate must pair in strict mode; RFC §8.2 mode replaces a lone one. def esc.b.pair(+strict: Bool, +len: U32, +i: U32, +hi: U32, acc: W, key: Bool, stack: List<&1, Open>, r: Array & Bool) -> Array & Sb: Json.u.class (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=u.class) # 0: not four hex digits; 1: high surrogate; 2: low surrogate; 3: other. def u.class(+v: U32) -> U32: Json.esc.b.u.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.u.of) def esc.b.u.of(+k: U32, strict: Bool, a: Array, +len: U32, +i: U32, +v: U32, acc: W, key: Bool, stack: List<&1, Open>) -> Array & Sb: Json.esc.b.u (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.u) def esc.b.u(strict: Bool, +len: U32, +i: U32, acc: W, key: Bool, stack: List<&1, Open>, r: Array & U32) -> Array & Sb: Json.esc.b.one (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.one) # The escape whose backslash is at i. def esc.b.one(strict: Bool, +len: U32, +i: U32, acc: W, key: Bool, stack: List<&1, Open>, r: Array & U32) -> Array & Sb: Json.esc.b.cp (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.cp) def esc.b.cp(acc: W, key: Bool, stack: List<&1, Open>, +i: U32, r: Array & Cp) -> Array & Sb: Json.esc.b.other (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b.other) # §7: unescaped chars below U+0020 are not allowed in a string. def esc.b.other(ascii: Bool, +c: U32, a: Array, +len: U32, +i: U32, acc: W, key: Bool, stack: List<&1, Open>) -> Array & Sb: Json.esc.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.b) # A string after its first escape. def esc.b(strict: Bool, r: Array & U32, +len: U32, +i: U32, acc: W, key: Bool, stack: List<&1, Open>) -> Array & Sb: Json.str.b.close (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.b.close) def str.b.close(key: Bool, +i: U32, stack: List<&1, Open>, r: Array & Bytes.Bytes) -> Array & Sb: Json.str.b.esc (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.b.esc) def str.b.esc(strict: Bool, +len: U32, +i: U32, key: Bool, stack: List<&1, Open>, r: Array & Bytes.Bytes) -> Array & Sb: Json.str.b.cp (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.b.cp) def str.b.cp(+start: U32, key: Bool, stack: List<&1, Open>, +i: U32, r: Array & Cp) -> Array & Sb: Json.str.b.other (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.b.other) def str.b.other(ascii: Bool, +c: U32, a: Array, +len: U32, +i: U32, +start: U32, key: Bool, stack: List<&1, Open>) -> Array & Sb: Json.str.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.b) # A string whose text so far starts at start and has no escape. def str.b(strict: Bool, r: Array & U32, +len: U32, +i: U32, +start: U32, key: Bool, stack: List<&1, Open>) -> Array & Sb: Json.num.b.fin (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.b.fin) def num.b.fin(+i: U32, stack: List<&1, Open>, r: Array & Bytes.Bytes) -> Array & Sb: Json.num.b.stop (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.b.stop) def num.b.stop(ok: Bool, a: Array, +i: U32, +start: U32, stack: List<&1, Open>) -> Array & Sb: Json.num.b.if (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.b.if) def num.b.if(stop: Bool, a: Array, +i: U32, +start: U32, +st: U32, +n: U32, stack: List<&1, Open>) -> Array & Sb: Json.num.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.b) def num.b(r: Array & U32, +i: U32, +start: U32, +st: U32, stack: List<&1, Open>) -> Array & Sb: Json.lit.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=lit.b) def lit.b(+i: U32, +n: U32, v: Val, stack: List<&1, Open>, r: Array & Bool) -> Array & Sb: Json.value.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=value.b) def value.b(r: Array & U32, +len: U32, +i: U32, stack: List<&1, Open>) -> Array & Sb: Json.first.b.end (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=first.b.end) # After "[" or "{": the closing bracket, or the first item. def first.b.end(open: Open, +c: U32, +i: U32, stack: List<&1, Open>) -> Sb: Json.first.b.open (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=first.b.open) def first.b.open(open: Open, +i: U32, stack: List<&1, Open>) -> Sb: Json.first.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=first.b) def first.b(r: Array & U32, +i: U32, open: Open, stack: List<&1, Open>) -> Array & Sb: Json.key.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=key.b) def key.b(r: Array & U32, +i: U32, stack: List<&1, Open>) -> Array & Sb: Json.colon.b.top (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=colon.b.top) def colon.b.top(k: Bytes.Bytes, +i: U32, stack: List<&1, Open>) -> Sb: Json.colon.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=colon.b) def colon.b(r: Array & U32, k: Bytes.Bytes, +i: U32, stack: List<&1, Open>) -> Array & Sb: Json.after.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=after.b) # A finished value joins its container. def after.b(v: Val, +i: U32, stack: List<&1, Open>) -> Sb: Json.sep.b.comma (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=sep.b.comma) def sep.b.comma(open: Open, +i: U32, up: List<&1, Open>) -> Sb: Json.sep.b.close (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=sep.b.close) def sep.b.close(open: Open, +c: U32, +i: U32, up: List<&1, Open>) -> Sb: Json.sep.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=sep.b) # After an item: "," or the closing bracket. def sep.b(r: Array & U32, +i: U32, open: Open, up: List<&1, Open>) -> Array & Sb: Json.end.b (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=end.b) def end.b(r: Array & U32, v: Val, +i: U32) -> Array & Sb: Json.value.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=value.r) # A run's end (a, i, c) to each step. The parts bind without + (bendlang/bend#1077). def value.r(+len: U32, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb: Json.level.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=level.r) def level.r(depth: U32, r: Array & Sb) -> Array & Sb & U32: Json.first.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=first.at) def first.at(a: Array, +c: U32, i: U32, +depth: U32, open: Open, stack: List<&1, Open>) -> Array & Sb & U32: Json.first.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=first.r) def first.r(ok: Bool, +depth: U32, open: Open, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb & U32: Json.first.limit (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=first.limit) def first.limit(cap: U32, +depth: U32, open: Open, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb & U32: Json.key.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=key.r) def key.r(stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb: Json.colon.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=colon.r) def colon.r(k: Bytes.Bytes, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb: Json.str.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=str.r) def str.r(strict: Bool, +len: U32, +s: U32, key: Bool, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb: Json.num.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.r) def num.r(+s: U32, +st: U32, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb: Json.sep.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=sep.at) def sep.at(a: Array, +c: U32, i: U32, +depth: U32, open: Open, up: List<&1, Open>) -> Array & Sb & U32: Json.sep.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=sep.r) def sep.r(+depth: U32, open: Open, up: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb & U32: Json.end.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=end.r) def end.r(v: Val, r: Array & U32 & U32) -> Array & Sb: Json.w.span.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=w.span.go) def w.span.go(n: Nat, r: Array & U32, +i: U32, o: W) -> Array & W: Json.esc.r.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.r.go) def esc.r.go(strict: Bool, +len: U32, +j: U32, c: U32, key: Bool, stack: List<&1, Open>, r: Array & W) -> Array & Sb: Json.esc.r (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=esc.r) # The plain bytes from i to the run's end go onto acc in one loop. def esc.r(strict: Bool, +len: U32, +i: U32, acc: W, key: Bool, stack: List<&1, Open>, r: Array & U32 & U32) -> Array & Sb: Json.num.run (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=num.run) # States 3, 5 and 8 take digits until the number's part ends. def num.run(loop: Bool, +g: Nat, a: Array, +len: U32, +i: U32) -> Array & U32 & U32: Json.runb (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=runb) # fuel: a step eats a byte, or ends a number, a value, or an opening bracket, so 4 * len + 4 steps are enough. def runb(+fuel: Nat, r: Array & Sb & U32, +len: U32, +strict: Bool, +cap: U32) -> Maybe<&1, Val>: Json.parse.bytes (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=parse.bytes) # One JSON text in UTF-8, with RFC §8.2 surrogate replacement and input-sized depth. def parse.bytes(b: Bytes.Bytes) -> Maybe<&1, Val>: Json.parse.strict.bytes (https://jend.leeeet.dev/definition.txt?path=bend-kit-json@0.7.0.0/json.bend&name=parse.strict.bytes) # Strict UTF-8 JSON: reject lone surrogate escapes and more than cap nested # arrays/objects, including empty containers. Scalars have depth zero. # The limit is checked at each opening, before any contents are parsed. def parse.strict.bytes(b: Bytes.Bytes, cap: U32) -> Maybe<&1, Val>: More: https://jend.leeeet.dev/packages/bend-kit-json.txt?definitions_offset=100