def packed_decode.go
bend-kit-protobuf@0.2.0.0 · protobuf.bend:485
import bend-kit-protobuf@0.2.0.0/protobuf.bend as Protobuf
import Base
485def packed_decode.go(fuel: Nat, +kind: U32, state: PackedState) -> Result<&2, &1, Error, List<&1, Value>>:
486 match fuel:
487 case 0n:
488 Fail{Limit{}}
489 case 1n+p:
490 PackedState{empty, c, acc} = state
491 match empty:
492 case True{}:
493 Done{List.reverse(&1, Value, acc)}
494 case False{}:
495 do Result<&2, &1, Error, List<&1, Value>>:
496 next : PackedState <- packed_decode.step(kind, c, acc)
497 packed_decode.go(p, kind, next)