fmt/yamlr.bend checks
raw source on the hub · import cswap-bend-cli@0.1.0.0/fmt/yamlr.bend as Yamlr
4 imports
import Base import ../json.bend as Json import ./ylex.bend as L import ./yscal.bend as S
Types
type Ln source · line 18 · raw
Data
Ln@ind:Nat -> @text:String -> Ln
type Plan source · line 22 · raw
Data
What val does next.
PRes@r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> Plan
PBlk@ls:List<&2, Ln> -> Plan
PArr@es:List<&2, List<&2, Ln>> -> Plan
PObj@es:List<&2, List<&2, Ln>> -> Plan
PItems@b:List<&2, Ln> -> @r:List<&2, List<&2, Ln>> -> Plan
PFieldI@k:String -> @v:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @r:List<&2, List<&2, Ln>> -> Plan
PFieldB@k:String -> @b:List<&2, Ln> -> @r:List<&2, List<&2, Ln>> -> Plan
type Acc source · line 52 · raw
Data
Acc@ls:List<&2, Ln> -> @seen:Bool -> @err:String -> Acc
type Sp source · line 127 · raw
Data
Sp@done:List<&2, List<&2, Ln>> -> @cur:List<&2, Ln> -> @hold:Bool -> Sp
type BKind source · line 243 · raw
Data
KSeqBKind
KMapBKind
KScalarBKind
Definitions
def lead.count source · line 35 · raw
@s:String -> @+n:Nat -> Nat
Leading spaces; a tab in the indentation is an error (-1 is not a Nat, so the flag travels beside).
def tab_lead source · line 42 · raw
@s:String -> Bool
def is_comment source · line 49 · raw
@+t:String -> Bool
def acc.add source · line 55 · raw
@+a:Acc -> @+raw:String -> Acc
def acc.fail source · line 60 · raw
@+a:Acc -> @msg:String -> Acc
def acc.skip source · line 65 · raw
@+a:Acc -> Acc
def acc.marker source · line 68 · raw
@+a:Acc -> @+seen:Bool -> Acc
def acc.seen source · line 71 · raw
@+a:Acc -> Bool
def acc.line2 source · line 76 · raw
@blank:Bool -> @marker:Bool -> @tab:Bool -> @+a:Acc -> @+raw:String -> Acc
def acc.line source · line 87 · raw
@+a:Acc -> @+raw:String -> Acc
def acc.go source · line 90 · raw
@rs:List<&2, String> -> @+a:Acc -> Acc
def lines.fin source · line 97 · raw
@+a:Acc -> Result<&2, &2, String, List<&2, Ln>>
def lines_of source · line 102 · raw
@+text:String -> Result<&2, &2, String, List<&2, Ln>>
def all_ge source · line 107 · raw
@ls:List<&2, Ln> -> @+n:Nat -> Bool
def is_dash source · line 114 · raw
@+t:String -> Bool
def key_empty.of source · line 117 · raw
@kv:0x0717344745a30ebad1f19045228e8f18/fmt/yscal.KV -> Bool
def key_empty source · line 124 · raw
@+t:String -> Bool
def sp.start source · line 130 · raw
@+sp:Sp -> @+l:Ln -> @hold:Bool -> Sp
def sp.more source · line 135 · raw
@+sp:Sp -> @+l:Ln -> Sp
def sp.hold source · line 140 · raw
@+sp:Sp -> Bool
def sp.step2 source · line 147 · raw
@new:Bool -> @+sp:Sp -> @+l:Ln -> @+t:String -> Sp
A line at the block's indent opens an entry, except a - line right under
an empty key: of a mapping (the sequence PyYAML writes at the key's indent).
def sp.step source · line 154 · raw
@+n:Nat -> @+map:Bool -> @+sp:Sp -> @+l:Ln -> Sp
def sp.go source · line 159 · raw
@ls:List<&2, Ln> -> @+n:Nat -> @+map:Bool -> @+sp:Sp -> Sp
def sp.fin source · line 166 · raw
@+sp:Sp -> List<&2, List<&2, Ln>>
def split source · line 171 · raw
@ls:List<&2, Ln> -> @+n:Nat -> @+map:Bool -> List<&2, List<&2, Ln>>
def bad source · line 176 · raw
@msg:String -> Plan
def item.text source · line 179 · raw
@+t:String -> String
def item.rest source · line 182 · raw
@+r:String -> String
def item.block source · line 185 · raw
@+n:Nat -> @+t:String -> @+rest:String -> @+body:List<&2, Ln> -> List<&2, Ln>
def items.head source · line 188 · raw
@dash:Bool -> @+n:Nat -> @+t:String -> @body:List<&2, Ln> -> @r:List<&2, List<&2, Ln>> -> Plan
def plan.items source · line 195 · raw
@es:List<&2, List<&2, Ln>> -> Plan
def field.extra source · line 204 · raw
@v:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @+k:String -> Plan
def field.both source · line 211 · raw
@no_body:Bool -> @+k:String -> @+rest:String -> @r:List<&2, List<&2, Ln>> -> Plan
def field.inline source · line 218 · raw
@empty:Bool -> @+k:String -> @+rest:String -> @body:List<&2, Ln> -> @r:List<&2, List<&2, Ln>> -> Plan
def field.kv source · line 225 · raw
@kv:0x0717344745a30ebad1f19045228e8f18/fmt/yscal.KV -> @body:List<&2, Ln> -> @r:List<&2, List<&2, Ln>> -> Plan
def plan.fields source · line 234 · raw
@es:List<&2, List<&2, Ln>> -> Plan
def kind.of2 source · line 248 · raw
@dash:Bool -> @kv:0x0717344745a30ebad1f19045228e8f18/fmt/yscal.KV -> BKind
def kind.of source · line 257 · raw
@+t:String -> BKind
def blk.scalar source · line 260 · raw
@single:Bool -> @+t:String -> Plan
def blk.kind source · line 267 · raw
@k:BKind -> @+n:Nat -> @+t:String -> @ls:List<&2, Ln> -> @+all:List<&2, Ln> -> Plan
def blk.fit source · line 276 · raw
@ok:Bool -> @+n:Nat -> @+t:String -> @ls:List<&2, Ln> -> @+all:List<&2, Ln> -> Plan
def plan.blk source · line 283 · raw
@+ls:List<&2, Ln> -> Plan
def item.cons source · line 292 · raw
@x:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> @rest:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json>
def val source · line 295 · raw
@fuel:Nat -> @pl:Plan -> Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json>
def parse.run source · line 314 · raw
@ls:List<&2, Ln> -> @+fuel:Nat -> Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json>
def parse.lines source · line 317 · raw
@r:Result<&2, &2, String, List<&2, Ln>> -> Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json>
def parse source · line 325 · raw
@+text:String -> Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json>
The value of a YAML document in the supported subset; Fail says what is not.