def emit
import bend-toon-codec@0.1.0.0/src/text.bend as Textimport Base
229# What character `c` emits in state `st`.
230def emit(+st: Us, +c: U32) -> Ek:
231 match st:
232 case UN{}:
233 ek.pick(U32.is_eq(c, 34), EkEnd{}, ek.pick(U32.is_eq(c, 92), EkNone{}, EkChar{c}))
234 case UB{}:
235 ek.pick(U32.is_eq(c, 117), EkNone{}, simple.emit(esc.code(c)))
236 case UH{k, acc}:
237 hex.emit(hex.val(c), k, acc)