def root.of

ezx@1.11.0.0 · src/ws/workspace.bend:534

import ezx@1.11.0.0/src/ws/workspace.bend as Workspace
import Base
import ezx@1.11.0.0/src/toml/toml.bend as T

534# the root, read from its ledger's text: a member under its `[package] name`
535# when it has a `[package]` table, a virtual root when it has none
536def root.of(+text: String) -> Root:
537  +ss = T.sects(T.parse(text))
538  +nn = T.value(pairs.of(ss, "package"), "name")
539  Bool.pick(Root, sect.has(ss, "package"), Package{nn}, Virtual{})

Uses (8)

Used by (5)