def Yaml.give

bend-kube-runtime@0.2.0.0 · src/yaml.bend:738

import bend-kube-runtime@0.2.0.0/src/yaml.bend as Yaml
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J

738# Hands v to the container on top: a mapping's pending key, a sequence's
739# next item, or the document itself.
740def Yaml.give(v: J.Json, st: List<&2, YFrame>) -> List<&2, YFrame>:
741  match st:
742    case Con{YMap{i, ms, Some{k}}, t}:
743      YMap{i, Yaml.member(k, v) <> ms, None{}} <> t
744    case Con{YSeq{i, xs, None{}}, t}:
745      YSeq{i, v <> xs, None{}} <> t
746    case Con{YSeq{i, xs, Some{a}}, t}:
747      YSeq{i, Yaml.wrap(a, v) <> xs, None{}} <> t
748    case Con{YMap{i, ms, None{}}, t}:
749      YMap{i, ms, None{}} <> t
750    case Con{YRoot{x}, t}:
751      YRoot{v} <> t
752    case Nil{}:
753      [YRoot{v}]

Uses (6)

Used by (3)