JSON.source: def of qasim-bend-kit@0.1.0.2 Import: import qasim-bend-kit@0.1.0.2/libs/JSON.bend as JSON Lines 1036-1060 of qasim-bend-kit@0.1.0.2/libs/JSON.bend: https://jend.leeeet.dev/read.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&start_line=1036&end_line=1060 import Base def source(value: Value, members: BoolType(), acc: List<&2, Lexeme>) -> List<&2, Lexeme>: match value: case Null{}: source_text("null", acc) case Bool{truth}: match truth: case True{}: source_text("true", acc) case False{}: source_text("false", acc) case Number{lexeme, certificate}: source_text(lexeme, acc) case Str{text}: source_text("\"" ++ escape_string(text) ++ "\"", acc) case Arr{Nil{}}: match members: case False{}: Punctuation{'['} <> Punctuation{']'} <> acc case True{}: Punctuation{']'} <> acc case Arr{head <> tail}: match members: case False{}: Punctuation{'['} <> source(head, False{}, source(Arr{tail}, True{}, acc)) case True{}: Punctuation{','} <> source(head, False{}, source(Arr{tail}, True{}, acc)) case Obj{Nil{}}: match members: case False{}: Punctuation{'{'} <> Punctuation{'}'} <> acc case True{}: Punctuation{'}'} <> acc case Obj{(key, value) <> tail}: match members: case False{}: Punctuation{'{'} <> source_text("\"" ++ escape_string(key) ++ "\"", Punctuation{':'} <> source(value, False{}, source(Obj{tail}, True{}, acc))) case True{}: Punctuation{','} <> source_text("\"" ++ escape_string(key) ++ "\"", Punctuation{':'} <> source(value, False{}, source(Obj{tail}, True{}, acc))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=BoolType https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=Lexeme https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=Value https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=escape_string https://jend.leeeet.dev/definition.txt?path=qasim-bend-kit@0.1.0.2/libs/JSON.bend&name=source_text