Cli.scan_ph: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 1283-1294 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=1283&end_line=1294 import Base # The placeholder name in s up to close, reversed in rev. A name holds no # space, '<', '>', '[', ']' or '=', and close is one of them. def scan_ph(s: String, +pos: Nat, rev: String, +close: Char) -> PhScan: match s: case SNil{}: PhBad{pos} case SCon{Chr{32}, tail}: ph_stop(Char.is_eq(' ', close), rev, tail, pos) case SCon{Chr{60}, tail}: ph_stop(Char.is_eq('<', close), rev, tail, pos) case SCon{Chr{62}, tail}: ph_stop(Char.is_eq('>', close), rev, tail, pos) case SCon{Chr{91}, tail}: ph_stop(Char.is_eq('[', close), rev, tail, pos) case SCon{Chr{93}, tail}: ph_stop(Char.is_eq(']', close), rev, tail, pos) case SCon{Chr{61}, tail}: ph_stop(Char.is_eq('=', close), rev, tail, pos) case SCon{h, tail}: scan_ph(tail, Nat.add(pos, 1n), SCon{h, rev}, close) Uses (11): 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=Char.is_eq 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=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 https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=PhScan https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=ph_stop