Quote.esc.char: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/json/quote.bend as Quote Lines 25-35 of cswap-bend-cli@0.1.0.0/json/quote.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/json/quote.bend&start_line=25&end_line=35 import Base import cswap-bend-cli@0.1.0.0/json/lex.bend as Lex # One char as Python's encoder writes it inside quotes. ensure_ascii escapes # everything above `~` (U+007F included); otherwise only controls. def esc.char(+ascii: Bool, +c: U32) -> String: Lex.sel.s(U32.is_eq(c, 34), "\\\"", Lex.sel.s(U32.is_eq(c, 92), "\\\\", Lex.sel.s(U32.is_eq(c, 10), "\\n", Lex.sel.s(U32.is_eq(c, 13), "\\r", Lex.sel.s(U32.is_eq(c, 9), "\\t", Lex.sel.s(U32.is_eq(c, 8), "\\b", Lex.sel.s(U32.is_eq(c, 12), "\\f", Lex.sel.s(U32.is_eq(c, 127), Lex.sel.s(ascii, uesc(127), SCon{Chr{127}, SNil{}}), esc.rest(ascii, c))))))))) Uses (8): 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=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json/lex.bend&name=sel.s https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json/quote.bend&name=esc.rest https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/json/quote.bend&name=uesc