def from.go
bend-kit-bytes@0.3.3.0 · bytes.bend:306
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import Base
306def from.go(s: String, a: Array<U32>, +i: U32, +w: U32) -> Array<U32>:
307 match s:
308 case SNil{}:
309 +r = (i .&. 3 : U32)
310 flush(U32.is_ne(r, 0), a, (i >> 2n : U32), U32.shrn(w, U32.to_nat((((4 - r) .&. 3) * 8 : U32))))
311 case SCon{Chr{+c}, t}:
312 +w2 = ((w >> 8n) .|. (b8(c) << 24n) : U32)
313 +full = U32.is_eq((i .&. 3 : U32), 3)
314 from.go(t, flush(full, a, (i >> 2n : U32), w2), (i + 1 : U32), Bool.pick(U32, full, 0, w2))