fmt/yscal.bend checks
raw source on the hub · import cswap-bend-cli@0.1.0.0/fmt/yscal.bend as Yscal
3 imports
import Base import ../json.bend as Json import ./ylex.bend as L
Types
type Sp source · line 132 · raw
Data
Sp@done:List<&2, String> -> @cur:String -> @q:U32 -> Sp
type KV source · line 231 · raw
Data
KNoneKV
KBad@msg:String -> KV
KOk@key:String -> @rest:String -> KV
Definitions
def comment.pick source · line 10 · raw
@hit:Bool -> @n:Nat -> @rest:Maybe<&2, Nat> -> Maybe<&2, Nat>
def comment.find source · line 18 · raw
@s:String -> @+n:Nat -> @+prev:Bool -> Maybe<&2, Nat>
Where a comment starts: a # at the start or after a space.
def comment.cut source · line 25 · raw
@m:Maybe<&2, Nat> -> @+s:String -> String
def uncomment source · line 33 · raw
@+s:String -> String
The text without a trailing comment, trimmed.
def sq.emit source · line 38 · raw
@skip:Bool -> @+c:U32 -> @rest:String -> String
def sq.unesc source · line 47 · raw
@s:String -> @+prevq:Bool -> String
'' inside single quotes is one quote. prevq: the last character was a
kept quote.
def dq.val source · line 54 · raw
@r:Result<&2, &2, String, 0x0717344745a30ebad1f19045228e8f18/json.Json> -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def first_code source · line 63 · raw
@s:String -> U32
def unquote.q source · line 70 · raw
@isd:Bool -> @+tok:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def unquote source · line 78 · raw
@+tok:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
A quoted token (quotes included) as the string it spells.
def str_of source · line 81 · raw
@r:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> Result<&2, &2, String, String>
def after_ok source · line 92 · raw
@+after:String -> Bool
def quoted.fin source · line 95 · raw
@ok:Bool -> @+tok:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def quoted.tok source · line 102 · raw
@m:Maybe<&2, Nat> -> @+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def special source · line 109 · raw
@+c:U32 -> Bool
def tagged source · line 112 · raw
@+c:U32 -> Bool
def atom.pick source · line 115 · raw
@isq:Bool -> @isb:Bool -> @ist:Bool -> @+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def atom source · line 127 · raw
@+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
A plain or quoted scalar (trimmed text).
def sp.push source · line 135 · raw
@+c:U32 -> @+sp:Sp -> Sp
def sp.cut source · line 140 · raw
@+sp:Sp -> Sp
def sp.quote source · line 145 · raw
@+c:U32 -> @+sp:Sp -> Sp
def sp.close source · line 150 · raw
@+c:U32 -> @+sp:Sp -> Sp
def sp.outside source · line 155 · raw
@+c:U32 -> @+sp:Sp -> Sp
def sp.q_of source · line 159 · raw
@sp:Sp -> U32
def sp.inside source · line 164 · raw
@+c:U32 -> @+sp:Sp -> Sp
def sp.step source · line 167 · raw
@+c:U32 -> @+sp:Sp -> Sp
def sp.go source · line 170 · raw
@s:String -> @+sp:Sp -> Sp
def sp.fin source · line 177 · raw
@+sp:Sp -> List<&2, String>
def split_top source · line 183 · raw
@+s:String -> List<&2, String>
The comma-separated pieces of a flow body, quotes respected.
def item.cons source · line 186 · raw
@x:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> @rest:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def flow.items source · line 195 · raw
@ps:List<&2, String> -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def wrap.arr source · line 202 · raw
@r:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def wrap.obj source · line 209 · raw
@r:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def inner source · line 216 · raw
@+s:String -> String
def last_code source · line 219 · raw
@s:String -> U32
def seq.fin source · line 222 · raw
@closed:Bool -> @+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def colon.pick source · line 237 · raw
@hit:Bool -> @n:Nat -> @rest:Maybe<&2, Nat> -> Maybe<&2, Nat>
Index of the first : that ends a key (followed by a space or the end).
def colon.find source · line 244 · raw
@s:String -> @+n:Nat -> Maybe<&2, Nat>
def kv.plain source · line 253 · raw
@m:Maybe<&2, Nat> -> @+s:String -> KV
def kv.colon source · line 260 · raw
@+k:String -> @+after:String -> KV
def kv.after source · line 267 · raw
@r:Result<&2, &2, String, String> -> @+after:String -> KV
def kv.quoted source · line 274 · raw
@m:Maybe<&2, Nat> -> @+s:String -> KV
def kv.pick source · line 281 · raw
@isq:Bool -> @isflow:Bool -> @+s:String -> KV
def split_kv source · line 291 · raw
@+s:String -> KV
The key: rest a line spells, when it spells one.
def field.cons source · line 294 · raw
@k:String -> @x:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> @rest:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def map.piece source · line 303 · raw
@kv:KV -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def map.cons source · line 313 · raw
@x:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> @rest:0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
Merge one piece's field in front of the chain.
def map.items source · line 324 · raw
@ps:List<&2, String> -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def map.fin source · line 331 · raw
@closed:Bool -> @+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def flow.pick source · line 338 · raw
@isseq:Bool -> @ismap:Bool -> @+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
def scalar source · line 348 · raw
@+s:String -> 0x0717344745a30ebad1f19045228e8f18/fmt/ylex.JR
A value after key: or - : flow collection, quoted or plain scalar.