Json.emit.go: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/json.bend as Json Lines 250-270 of cswap-bend-cli@0.1.0.0/json.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/json.bend&start_line=250&end_line=270 import Base import cswap-bend-cli@0.1.0.0/json/quote.bend as Quote # The emitter. `j` shrinks on every call; `d` is the nesting depth. def emit.go(j: Json, +style: U32, +ascii: Bool, +d: Nat) -> String: match j: case JNull{}: "null" case JBool{b}: bool.show(b) case JNum{t}: t case JStr{s}: Quote.quote(s, ascii) case JArr{+items}: emit.wrap("[", "]", items, emit.go(items, style, ascii, Nat.add(d, 1n)), style, d) case JObj{+fields}: emit.wrap("{", "}", fields, emit.go(fields, style, ascii, Nat.add(d, 1n)), style, d) case JNil{}: "" case JCons{h, +t}: emit.go(h, style, ascii, d) ++ sep.of(t, style, d) ++ emit.go(t, style, ascii, d) case JField{k, v, +t}: Quote.quote(k, ascii) ++ Quote.colon(style) ++ emit.go(v, style, ascii, d) ++ sep.of(t, style, d) ++ emit.go(t, style, ascii, d) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json/quote.bend&name=colon https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json/quote.bend&name=quote https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=bool.show https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=emit.wrap https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json.bend&name=sep.of