def finish

yaml-for-bend@0.1.1.0 · compose.bend:354

import yaml-for-bend@0.1.1.0/compose.bend as Compose
import Base

354# A node of +size+ nodes is finished: its anchor names it, and the count
355# grows by +more+ (the nodes not counted yet: a collection's items were).
356def finish(co: Co, anchor: Maybe<&2, String>, +item: Item, +size: Nat, more: Nat) -> Co:
357  match co:
358    case Co{stack, anchors, count, root, docs, opened, depth, copied}:
359      attach(Co{stack, name.anchor(anchors, anchor, item.val(item), size), Nat.add(count, more), root, docs, opened, depth, copied}, item)

Uses (9)

Used by (2)