def cd.go
bend-kit-archive@0.5.1.0 · archive.bend:202
import bend-kit-archive@0.5.1.0/archive.bend as Archive
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
202
203def cd.go(k: Nat, r: Array<U32> & Result<&1, &1, U32 & String, U32 & List<&2, Header>>, +end: U32, +cdoff: U32) -> Array<U32> & Result<&1, &1, U32 & String, List<&2, Header>>:
204 match k:
205 case 0n:
206 (a, res) = r
207 (a, cd.fin(res, end))
208 case 1n+q:
209 (a, res) = r
210 match res:
211 case Fail{e}:
212 (a, Fail{e})
213 case Done{(+p, acc)}:
214 cd.go(q, cd.entry(Bytes.fits(end, p, 46), a, p, end, cdoff, acc), end, cdoff)