def utf8.go
import bend-kit-cbor@0.3.0.0/cbor.bend as Cborimport Base
198# Each step eats a whole code point, so end - i steps reach end.
199def utf8.go(n: Nat, r: Array<U32> & U32 & Bool, +end: U32) -> Array<U32> & Bool:
200 match n:
201 case 0n:
202 (a, i, ok) = r
203 (a, ok)
204 case 1n+p:
205 (a, +i, ok) = r
206 utf8.go(p, utf8.step(ok, a, end, i), end)