def dec.lead

ezmcp@0.1.0.0 · src/line.bend:157

import ezmcp@0.1.0.0/src/line.bend as Line
import Base

157# one sequence at a lead byte of width w, then `go` on what follows
158def dec.lead(
159  +byte: U32,
160  tail: List<&2, U32>,
161  wid: Width,
162  go: List<&2, U32> -> String
163) -> String:
164  match wid:
165    case W1{}:
166      SCon{Chr{byte}, go(tail)}
167    case W2{}:
168      dec.two(byte, tail, go)
169    case W3{}:
170      dec.three(byte, tail, go)
171    case W4{}:
172      dec.four(byte, tail, go)
173    case W0{}:
174      SCon{bad(), go(tail)}

Uses (9)

Used by (1)