def put
import bolt@1.27.0.0/src/syntax/tree.bend as Treeimport Base
169# a finished node lands in the frame below
170def put(stack: List<&2, Frame>, nn: Node) -> List<&2, Frame>:
171 match stack:
172 case Nil{}:
173 Nil{}
174 case Con{FGroup{open, kids}, rest}:
175 FGroup{open, NCons{nn, kids}} <> rest
176 case Con{FStmt{indent, kids, body}, rest}:
177 FStmt{indent, NCons{nn, kids}, body} <> rest
178 case Con{FRoot{body}, rest}:
179 FRoot{NCons{nn, body}} <> rest