def text.case.covers

ezsys@0.1.0.0 · src/str.bend:227

import ezsys@0.1.0.0/src/str.bend as Str
import Base

227# whether a rule maps the code point
228def text.case.covers(rule: Rule, +cp: U32) -> Bool:
229  match rule:
230    case Rule{+lo, +hi, +step, _to}:
231      Bool.and(Bool.and(U32.is_ge(cp, lo), U32.is_le(cp, hi)),
232        U32.is_eq(((cp - lo) % step : U32), 0))

Uses (9)

Used by (1)