def colon.find

cswap-bend-cli@0.1.0.0 · fmt/yscal.bend:244

import cswap-bend-cli@0.1.0.0/fmt/yscal.bend as Yscal
import Base
import cswap-bend-cli@0.1.0.0/fmt/ylex.bend as L

244def colon.find(s: String, +n: Nat) -> Maybe<&2, Nat>:
245  match s:
246    case SNil{}:
247      None{}
248    case SCon{Chr{c}, SNil{}}:
249      colon.pick(U32.is_eq(c, 58), n, None{})
250    case SCon{Chr{+c}, SCon{Chr{+d}, t}}:
251      colon.pick(U32.is_eq(c, 58) && L.is_space(d), n, colon.find(SCon{Chr{d}, t}, Nat.add(n, 1n)))

Uses (9)

Used by (1)