Cli.roff_body: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 6172-6185 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=6172&end_line=6185 import Base # Text for man(7), start telling whether a line starts here: \, -, ", ' # and ` as escapes, and \& before a . or a space that starts a line. def roff_body(s: String, start: Bool) -> String: match s start: case SNil{} _: SNil{} case SCon{Chr{46}, tail} True{}: String.append("\\&.", roff_body(tail, False{})) case SCon{Chr{32}, tail} True{}: String.append("\\& ", roff_body(tail, False{})) case SCon{Chr{10}, tail} _: SCon{'\n', roff_body(tail, True{})} case SCon{Chr{92}, tail} _: String.append("\\e", roff_body(tail, False{})) case SCon{Chr{45}, tail} _: String.append("\\-", roff_body(tail, False{})) case SCon{Chr{34}, tail} _: String.append("\\(dq", roff_body(tail, False{})) case SCon{Chr{39}, tail} _: String.append("\\(aq", roff_body(tail, False{})) case SCon{Chr{96}, tail} _: String.append("\\(ga", roff_body(tail, False{})) case SCon{c, tail} _: SCon{c, roff_body(tail, False{})} Uses (7): 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=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil