Compose.co.close: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/compose.bend as Compose Lines 417-429 of yaml-for-bend@0.1.1.0/compose.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/compose.bend&start_line=417&end_line=429 import Base import yaml-for-bend@0.1.1.0/token.bend as T import yaml-for-bend@0.1.1.0/value.bend as V # The collection on top ends. def co.close(co: Co) -> Result<&2, &2, T.Error, Co>: match co: case Co{stack, anchors, +count, root, docs, opened, depth, copied}: match stack: case Nil{}: Fail{content("found the end of a collection that never started", T.Mark{0n, 0n, 0n})} case Con{top, rest}: match top: case OSeq{anchor, tag, items, start, +at}: node.done(Done{collection(tag, V.Seq{List.reverse(&2, V.Yaml, items)})}, Co{rest, anchors, count, root, docs, opened, Nat.sub(depth, 1n), copied}, anchor, False{}, 1n+Nat.sub(count, start), 1n, at) case OMap{anchor, tag, items, start, +at}: node.done(map.tagged(map.value(List.reverse(&2, Item, items)), tag), Co{rest, anchors, count, root, docs, opened, Nat.sub(depth, 1n), copied}, anchor, False{}, 1n+Nat.sub(count, start), 1n, at) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=Co https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=Item https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=Open https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=collection https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=content https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=map.tagged https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=map.value https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=node.done https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/token.bend&name=Error https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/token.bend&name=Mark https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/value.bend&name=Yaml