Protobuf.decode.go: def of bend-kit-protobuf@0.2.0.0 Import: import bend-kit-protobuf@0.2.0.0/protobuf.bend as Protobuf Lines 260-277 of bend-kit-protobuf@0.2.0.0/protobuf.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&start_line=260&end_line=277 import Base # Explicit group stack keeps decoding linear and avoids mutually recursive parsers. def decode.go(fuel: Nat, state: DecodeState) -> Result<&2, &1, Error, List<&1, Field>>: match fuel: case 0n: Fail{Limit{}} case 1n+p: DecodeState{empty, c, depth, stack, acc} = state match empty: case True{}: match stack: case Nil{}: Done{List.reverse(&1, Field, acc)} case Con{h, t}: Fail{Incomplete{}} case False{}: do Result<&2, &1, Error, List<&1, Field>>: next : DecodeState <- decode.step(c, depth, stack, acc) decode.go(p, next) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.bind https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=DecodeState https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=Field https://jend.leeeet.dev/definition.txt?path=bend-kit-protobuf@0.2.0.0/protobuf.bend&name=decode.step