def St.header

bendtorch-load@1.3.0.0 · main.bend:541

import bendtorch-load@1.3.0.0/main.bend as BendtorchLoad
import Base

541def St.header(+path: String, +len: U32, r: File & Result<&1, &1, U32 & String, List<&2, U32>>) -> IO(Header):
542  match r:
543    case Tuple{f, res}:
544      do IO<Header>:
545        +bs : List<&2, U32> <- IO.pass(List<&2, U32>, res)
546        File.close(f)
547        require(U32.is_eq(St.count(bs, 0), len), path ++ ": the header is cut short")
548        St.parsed(path, W64.add(W64.of(8), W64.of(len)), Sp.parse(St.lex(bs, LexR{LOut{}, Nil{}}, Nil{}), Ps{0, False{}, "", "", "", "", Nil{}, Nil{}, Nil{}, Nil{}, 0}))

Uses (26)

Used by (1)