def Yaml.uncomment

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

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

98# Drops a comment, to the end of the line.
99def Yaml.uncomment(s: String, +q: U32, cut: Bool) -> String:
100  match s cut:
101    case _ True{}:
102      SNil{}
103    case SNil{} False{}:
104      SNil{}
105    case SCon{+c, +t} False{}:
106      SCon{c, Yaml.uncomment(t, Yaml.nq(c, q), Yaml.cut_at(t, Yaml.nq(c, q), Char.is_space(c)))}

Uses (6)

Used by (1)