def scalar.text

yaml-for-bend@0.1.1.0 · emit.bend:176

import yaml-for-bend@0.1.1.0/emit.bend as Emit
import Base
import yaml-for-bend@0.1.1.0/value.bend as V

176# A scalar's text, or an empty collection's.
177def scalar.text(v: V.Yaml) -> String:
178  match v:
179    case V.Null{}:
180      "null"
181    case V.Boolean{on}:
182      Bool.pick(String, on, "true", "false")
183    case V.Int{t}:
184      t
185    case V.Float{t}:
186      t
187    case V.Str{t}:
188      str.text(t)
189    case V.Seq{xs}:
190      "[]"
191    case V.Mapping{es}:
192      "{}"
193    case V.Tagged{t, x}:
194      ""

Uses (4)

Used by (1)