def tables
ezx@1.13.0.0 · src/toml/toml.bend:292
import ezx@1.13.0.0/src/toml/toml.bend as Toml
import Base
import emerging-eztoml@0.10.0.0/main.bend as E
292
293
294
295def tables(rows: List<&2, E.Val>, +segs: List<&2, String>) -> List<&2, Sect>:
296 match rows:
297 case []:
298 []
299 case E.VPair{name, E.VHead{_path, +sub}} <> tl:
300 +at : List<&2, String> = name <> segs
301 List.append(&2, Sect, table.sects(at, sub, tables(sub, at)), tables(tl, segs))
302 case _hd <> tl:
303 tables(tl, segs)