def sect.put
import ezx@1.11.0.0/src/toml/toml.bend as Tomlimport Base
273# a table's section, when it holds a pair or no table. A table that holds
274# only tables is the parent a dotted header implies, which ez never writes a
275# pair into; old ledgers and locks name no such table, so it is no section.
276# (segs arrive innermost first, as `tables` builds them; the header reads
277# them outermost first)
278def sect.put(skip: Bool, +ps: List<&2, Kv>, +segs: List<&2, String>) -> List<&2, Sect>:
279 match skip:
280 case True{}:
281 []
282 case False{}:
283 [Sect{head.of(List.reverse(&2, String, segs)), ps}]