def comment.find
import cswap-bend-cli@0.1.0.0/fmt/yscal.bend as Yscalimport Base
import cswap-bend-cli@0.1.0.0/fmt/ylex.bend as L
17# Where a comment starts: a `#` at the start or after a space.
18def comment.find(s: String, +n: Nat, +prev: Bool) -> Maybe<&2, Nat>:
19 match s:
20 case SNil{}:
21 None{}
22 case SCon{Chr{+c}, t}:
23 comment.pick(prev && U32.is_eq(c, 35), n, comment.find(t, Nat.add(n, 1n), L.is_space(c)))