def Yaml.in_block.go

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

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

221def Yaml.in_block.go(out: List<&2, Line>, b: Blk, +raw: String, blank: Bool, deeper: Bool,
222  first: Bool) -> LS:
223  match b blank deeper first:
224    case Blk{ki, p, f, c, bi, acc} True{} _ _:
225      LS{out, Some{Blk{ki, p, f, c, bi, SNil{} <> acc}}}
226    case Blk{ki, p, f, c, bi, acc} False{} True{} True{}:
227      LS{out, Some{Blk{ki, p, f, c, Yaml.indent(raw, 0), String.drop(raw, U32.to_nat(Yaml.indent(raw, 0))) <> acc}}}
228    case Blk{ki, p, f, c, +bi, acc} False{} True{} False{}:
229      LS{out, Some{Blk{ki, p, f, c, bi, String.drop(raw, U32.to_nat(bi)) <> acc}}}
230    case +x False{} False{} _:
231      Yaml.normal(Yaml.block.line(x) <> out, raw)

Uses (12)

Used by (1)