def pop

bend-toon-codec@0.1.0.0 · src/frame.bend:186

import bend-toon-codec@0.1.0.0/src/frame.bend as Frame
import Base

186# Close every frame whose child depth is at least `t`. `fuel` is the stack
187# height, enough for every frame to close.
188def pop(+fuel: Nat, +sr: Result<&2, &2, String, St>, +t: U32, +strict: Bool) -> Result<&2, &2, String, St>:
189  match fuel sr:
190    case 0n _:
191      sr
192    case 1n+p Fail{e}:
193      Fail{e}
194    case 1n+p Done{st}:
195      pop(p, close.if(should_pop(stk.of(st), t), st, strict), t, strict)

Uses (9)

Used by (2)