def fuel
import bend-toon-codec@0.1.0.0/src/decode.bend as Decodeimport Base
import bend-toon-codec@0.1.0.0/src/frame.bend as F
42# The stack height: enough steps to close every frame.
43def fuel(+r: Result<&2, &2, String, F.St>) -> Nat:
44 match r:
45 case Done{F.St{stk, root, bmin}}:
46 List.length(&2, F.Fr, stk)
47 case Fail{e}:
48 0n