def next

bend-toon-codec@0.1.0.0 · src/text.bend:198

import bend-toon-codec@0.1.0.0/src/text.bend as Text
import Base

198# The state after reading character `c`.
199def next(+st: Us, +c: U32) -> Us:
200  match st:
201    case UN{}:
202      us.pick(U32.is_eq(c, 92), UB{}, UN{})
203    case UB{}:
204      us.pick(U32.is_eq(c, 117), UH{4, 0}, UN{})
205    case UH{k, acc}:
206      hex.next(hex.val(c), k, acc)

Uses (6)

Used by (1)