def rest_ok
import cswap-bend-cli@0.1.0.0/fmt/ylex.bend as Yleximport Base
143# Scan the rest: no control characters, no ": " or trailing ":", no " #".
144def rest_ok(s: String, +prev: U32) -> Bool:
145 match s:
146 case SNil{}:
147 Bool.not(U32.is_eq(prev, 58)) && Bool.not(is_space(prev))
148 case SCon{Chr{+c}, t}:
149 Bool.not(bad_char(c)) && Bool.not(U32.is_eq(prev, 58) && is_space(c)) && Bool.not(is_space(prev) && U32.is_eq(c, 35)) && rest_ok(t, c)