def scalar.value
yaml-for-bend@0.1.1.0 · compose.bend:266
import yaml-for-bend@0.1.1.0/compose.bend as Compose
import Base
import yaml-for-bend@0.1.1.0/parse.bend as P
import yaml-for-bend@0.1.1.0/value.bend as V
import yaml-for-bend@0.1.1.0/core.bend as C
import yaml-for-bend@0.1.1.0/yaml11.bend as Y11
266def scalar.value(s: Schema, t: P.Tag, +text: String, +plain: Bool) -> Result<&2, &2, String, V.Yaml>:
267 match s:
268 case Core{}:
269 match t:
270 case P.NoTag{}:
271 Done{when(V.Yaml, plain, u => C.plain(text), u => V.Str{text})}
272 case P.Tag{n}:
273 C.tagged(n, text)
274 case Yaml11{}:
275 match t:
276 case P.NoTag{}:
277 Done{when(V.Yaml, plain, u => Y11.plain(text), u => V.Str{text})}
278 case P.Tag{n}:
279 Y11.tagged(n, text)