fmt/yamlw.bend checks
raw source on the hub · import cswap-bend-cli@0.1.0.0/fmt/yamlw.bend as Yamlw
4 imports
import Base import ../json.bend as Json import ../json/quote.bend as Quote import ./ylex.bend as L
Types
type Ctx source · line 13 · raw
Data
Where a value sits: the document, after key:, after - , or inside a
chain of fields or items.
CTopCtx
CKeyCtx
CItemCtx
CChainCtx
Definitions
def pad source · line 19 · raw
@+d:Nat -> String
def str source · line 22 · raw
@+s:String -> String
def lead source · line 26 · raw
@+k:Ctx -> String
Before a scalar: a space after key:.
def ind source · line 34 · raw
@+k:Ctx -> @+d:Nat -> Nat
The indent of a container's lines.
def pre source · line 42 · raw
@+k:Ctx -> @+d:Nat -> String
Before a container's first line: under a key it starts a new line.
def is_nil source · line 49 · raw
@j:0x0717344745a30ebad1f19045228e8f18/json.Json -> Bool
def cont source · line 56 · raw
@empty:Bool -> @+k:Ctx -> @+d:Nat -> @lit:String -> @body:String -> String
def sep source · line 64 · raw
@t:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+d:Nat -> @rest:String -> String
A new line for the next field or item, none at the end of the chain.
def y source · line 73 · raw
@j:0x0717344745a30ebad1f19045228e8f18/json.Json -> @+k:Ctx -> @+d:Nat -> String
j at the base indent d in context k. Chains (fields, items) carry their
lines at d; the first line of a chain starts wherever the caller left off.
def emit source · line 95 · raw
@j:0x0717344745a30ebad1f19045228e8f18/json.Json -> String
One YAML document for the value (no ---, no trailing newline).