def tree.leaf.aot.hit

emerging-eztoml@0.9.0.0 · main.bend:2182

import emerging-eztoml@0.9.0.0/main.bend as EmergingEztoml
import Base

2182# append one element of an array of tables
2183def tree.leaf.aot.hit(
2184  hit: Look,
2185  name: String,
2186  vs: List<&2, Val>,
2187  stack: List<&2, Fr>,
2188  bad: String,
2189  +path: String,
2190  heads: List<&2, String>
2191) -> End:
2192  match hit:
2193    case KMiss{}:
2194      tree.rebuild(stack, VPair{name, VAots{path, [VAot{path, []}]}} <> vs, bad, heads)
2195    case KAots{_p, elems}:
2196      tree.rebuild(stack, rows.repl(vs, name, VAots{path, VAot{path, []} <> elems}),
2197        bad, heads.drop(heads, path ++ "."))
2198    case KHead{_p, _rows}:
2199      tree.rebuild(stack, vs, err.first(bad, "not a table"), heads)
2200    case KInl{}:
2201      tree.rebuild(stack, vs, err.first(bad, "inline table is closed"), heads)
2202    case KNo{why}:
2203      tree.rebuild(stack, vs, err.first(bad, why), heads)

Uses (11)

Used by (1)