def groups
import bolt@1.27.0.0/src/syntax/tree.bend as Treeimport Base
210# how many groups sit open on top of the stack
211def groups(stack: List<&2, Frame>) -> Nat:
212 match stack:
213 case Con{FGroup{open, kids}, rest}:
214 Succ{groups(rest)}
215 case other:
216 0n