main.bend checks
raw source on the hub · import emerging-eztoml@0.11.0.0/main.bend as Main
eztoml: TOML for Bend 2, a proven parser and renderer for TOML documents.
eztoml reads and writes TOML documents. Values are strings, integers, floats, booleans, datetimes, arrays, inline tables, tables, and arrays of tables. Comments and blank lines are passed over.
parse, render, get, at, root, bad, string, digits, flag str, integer, float, boolean, array, inline, table, pair key, wf
1 import
import Base
Types
type Sign source · line 13 · raw
Data
the sign of an integer, a float, or a zone offset
PlusSign
MinusSign
type Date source · line 18 · raw
Data
a calendar date: year, month, day
Date@y:U32 -> @mo:U32 -> @d:U32 -> Date
type Clock source · line 22 · raw
Data
a time of day. frac is the fractional second, empty when there is none
Clock@h:U32 -> @mi:U32 -> @s:U32 -> @frac:String -> Clock
type Zone source · line 26 · raw
Data
a zone offset: Z, or a numeric offset
ZuluZone
Shift@sign:Sign -> @h:U32 -> @mi:U32 -> Zone
type When source · line 31 · raw
Data
the four TOML datetime forms
WOff@date:Date -> @clock:Clock -> @zone:Zone -> When
WLocal@date:Date -> @clock:Clock -> When
WDate@date:Date -> When
WTime@clock:Clock -> When
type Val source · line 41 · raw
Data
one TOML value. Tables remember the dotted path they were opened under. An inline table is VInl. An array of tables is VAots, and each element is VAot. VPair is a key in a table. VSpan is a plain string: the first n characters of a source suffix.
VStr@text:String -> Val
VSpan@src:String -> @n:U32 -> Val
VInt@sign:Sign -> @digits:String -> Val
VFlo@sign:Sign -> @text:String -> Val
VBool@bit:Bool -> Val
VWhen@when:When -> Val
VArr@items:List<&2, Val> -> Val
VInl@rows:List<&2, Val> -> Val
VHead@path:String -> @rows:List<&2, Val> -> Val
VAot@path:String -> @rows:List<&2, Val> -> Val
VAots@path:String -> @elems:List<&2, Val> -> Val
VPair@name:String -> @val:Val -> Val
type Hit source · line 56 · raw
Data
a key found in a table, or not
Found@val:Val -> Hit
MissHit
type Doc source · line 61 · raw
Data
a parsed document: the first error, and the root table in order
Doc@bad:String -> @rows:List<&2, Val> -> Doc
type Got source · line 65 · raw
Data
a value read from a bare word, or the reason it is not one
GotVal@val:Val -> Got
GotBad@why:String -> Got
type Dig source · line 70 · raw
Data
digits taken from the front of a character list
DigOk@n:U32 -> @cs:List<&2, Char> -> Dig
DigBadDig
type WhenOut source · line 75 · raw
Data
what a datetime scan produced
WSome@when:When -> WhenOut
WFail@why:String -> WhenOut
WSkipWhenOut
type NK source · line 81 · raw
Data
a decimal numeral being built, least-significant digit first
NLeadNK
NSignNK
NZeroNK
NDigNK
NBaseNK
NFracNK
NExpNK
NEDigNK
NBadNK
type Num source · line 93 · raw
Data
the numeral scan
Num@nk:NK -> @sign:Sign -> @base:U32 -> @ds:List<&2, U32> -> @us:Bool -> @saw:Bool -> @why:String -> Num
type BK source · line 98 · raw
Data
how a basic-string character is written
BKChBK
BKHexBK
BKEsc@mark:Char -> BK
type Lex source · line 104 · raw
Data
where the scanner is in a document
LTopLex
LLineLex
LKeyLex
LKeyDotLex
LAfterLex
LKeyQLex
LKeyELex
LKeyULex
LValLex
LQLex
LQ2Lex
LStrLex
LEscLex
LUniLex
LFoldLex
LMqLex
LMqEndLex
LTrimLex
LTrim2Lex
LBareLex
LDateLex
LComLex
LHeadLex
LHeadGapLex
LHeadDotLex
LHeadQLex
LHeadELex
LHeadULex
LHeadRLex
LArrLex
LArrCLex
LInlLex
LInlKLex
LInlCLex
LSinkLex
type QKind source · line 142 · raw
Data
which quotes a string is using
QBasicQKind
QLitQKind
QMultiQKind
QMultiLitQKind
type Hold source · line 149 · raw
Data
one character to read again
HNoneHold
HChar@c:Char -> Hold
type Ctx source · line 154 · raw
Data
an open array or inline table
CArr@items:List<&2, Val> -> @parts:List<&2, String> -> @here:List<&2, String> -> Ctx
CInl@rows:List<&2, Val> -> @parts:List<&2, String> -> @here:List<&2, String> -> Ctx
type St source · line 159 · raw
Data
the scanner
St@bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @lex:Lex -> @back:Lex -> @qkind:QKind -> @stack:List<&2, Ctx> -> @hold:Hold -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> St
type Esc source · line 166 · raw
Data
an escape in a basic string
EChar@c:Char -> Esc
EUni@n:U32 -> Esc
EFold@saw:Bool -> Esc
EBadEsc
type Job source · line 1872 · raw
Data
a change applied at the end of a key path
JPut@val:Val -> Job
JDefJob
JAotJob
type Fr source · line 1878 · raw
Data
one table the walk has entered
FrNew@name:String -> @parent:List<&2, Val> -> @path:String -> Fr
FrRep@name:String -> @parent:List<&2, Val> -> @path:String -> Fr
FrAot@name:String -> @parent:List<&2, Val> -> @pre:List<&2, Val> -> @path:String -> Fr
type Tw source · line 1884 · raw
Data
the walk: the table being edited, and the frames above it
Tw@vs:List<&2, Val> -> @job:Job -> @stack:List<&2, Fr> -> @bad:String -> @pre:String -> @heads:List<&2, String> -> @inl:Bool -> Tw
type End source · line 1889 · raw
Data
the root table after a walk
End@vs:List<&2, Val> -> @bad:String -> @heads:List<&2, String> -> End
type Look source · line 1893 · raw
Data
what a key in a table refers to
KMissLook
KHead@path:String -> @rows:List<&2, Val> -> Look
KInlLook
KAots@path:String -> @elems:List<&2, Val> -> Look
KNo@why:String -> Look
type Last source · line 1901 · raw
Data
the last element of an array of tables
LastSome@path:String -> @pre:List<&2, Val> -> @rows:List<&2, Val> -> Last
LastNo@why:String -> Last
type Walk source · line 2258 · raw
Data
the walk fields a descent into one key carries through
Walk@job:Job -> @stack:List<&2, Fr> -> @pre:String -> @heads:List<&2, String> -> @inl:Bool -> Walk
type Keep source · line 2656 · raw
Data
the scanner fields placing a finished value keeps
Keep@back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> Keep
type HeadKeep source · line 2769 · raw
Data
the scanner fields opening a header keeps
HeadKeep@back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> HeadKeep
type Letters source · line 3030 · raw
Data
which escape letter a character is: b, t, n, f, r, u, or U
Letters@bb:Bool -> @tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Letters
type TopCh source · line 3201 · raw
Data
what a top-level character may open: a header, a quoted key, or a bare key
TopCh@br:Bool -> @qq:Bool -> @lit:Bool -> @bare:Bool -> TopCh
type ValCh source · line 3411 · raw
Data
what a value's first character may open: a string, an array, or an inline table
ValCh@qq:Bool -> @lit:Bool -> @br:Bool -> @inl:Bool -> ValCh
type HeadCh source · line 3952 · raw
Data
a header character that is a quote or starts a comment
HeadCh@qq:Bool -> @lit:Bool -> @hash:Bool -> HeadCh
type Fast source · line 4706 · raw
Data
the scanner fields the fast step carries through unchanged
Fast@bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @back:Lex -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> Fast
type Mode source · line 4900 · raw
Data
where the next source character is read. MEat is the body of a plain string, and MCr follows a carriage return, which only a line feed may follow
MScan@st:St -> Mode
MCr@st:St -> Mode
MOpen@basic:Bool -> @q:Char -> @qkind:QKind -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @back:Lex -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> Mode
MEat@basic:Bool -> @q:Char -> @cut:String -> @n:U32 -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @qkind:QKind -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> Mode
type Carry source · line 4912 · raw
Data
the scanner fields a plain-string span carries through unchanged
Carry@bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @qkind:QKind -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> Carry
type Sq source · line 5234 · raw
Data
a span walked for quoting. SqOk is the body reversed, with the closing quote already on
SqOk@rev:List<&2, Char> -> Sq
SqNoSq
type SqAcc source · line 5239 · raw
Data
the reversed body while a span is still plain. SqStop means an escape was seen
SqRun@rev:List<&2, Char> -> SqAcc
SqStopSqAcc
type WfAt source · line 5616 · raw
Data
where a list of values sits: a table's rows under its path (the root's is ""), an inline table's rows, an array's items, or the elements of an array of tables under its path
WfRows@path:String -> WfAt
WfInlWfAt
WfItemsWfAt
WfElems@path:String -> WfAt
type Fl source · line 5624 · raw
Data
how far a float's spelling has been read: toml.abnf's float with no sign
and no underscore, dec-int ( exp / frac [ exp ] )
FlStartFl
FlZeroFl
FlIntFl
FlDotFl
FlFracFl
FlEFl
FlESignFl
FlExpFl
FlNoFl
Definitions
def bare.at source · line 173 · raw
@+cc:Char -> Bool
a character a bare key may hold
def bare.all.step source · line 178 · raw
@here:Bool -> @rest:(@_:Unit -> Bool) -> Bool
one step of the bare-key walk, with the head's answer in hand
def bare.all source · line 186 · raw
@cs:List<&2, Char> -> Bool
whether every character of a key is one a bare key may hold
def bare source · line 194 · raw
@+ss:String -> Bool
whether a key can be written without quotes
def hex.char.go source · line 198 · raw
@dec:Bool -> @nn:U32 -> Char
one hex nibble as a character
def hex.char source · line 206 · raw
@+nn:U32 -> Char
one hex nibble as a character
def basic.hex source · line 210 · raw
@+uu:U32 -> @out:List<&2, Char> -> List<&2, Char>
four lowercase hex digits of a code point, then the \u introducer, reversed
def basic.esc source · line 216 · raw
@mark:Char -> @out:List<&2, Char> -> List<&2, Char>
an escape mark reversed onto the output: the mark, then the backslash
def basic.cls.hex source · line 220 · raw
@hit:Bool -> BK
other controls are \u escapes; the rest are themselves
def basic.cls.bslash source · line 228 · raw
@hit:Bool -> @+uu:U32 -> BK
backslash
def basic.cls.quote source · line 236 · raw
@hit:Bool -> @+uu:U32 -> BK
quotation mark
def basic.cls.cr source · line 244 · raw
@hit:Bool -> @+uu:U32 -> BK
carriage return
def basic.cls.ff source · line 252 · raw
@hit:Bool -> @+uu:U32 -> BK
form feed
def basic.cls.lf source · line 260 · raw
@hit:Bool -> @+uu:U32 -> BK
line feed
def basic.cls.tab source · line 268 · raw
@hit:Bool -> @+uu:U32 -> BK
tab
def basic.cls.bs source · line 276 · raw
@hit:Bool -> @+uu:U32 -> BK
backspace, then the rest
def basic.cls source · line 284 · raw
@+uu:U32 -> BK
the class of a code point in a basic string
def basic.disp source · line 288 · raw
@kk:BK -> @cc:Char -> @uu:U32 -> @out:List<&2, Char> -> List<&2, Char>
one character of a basic string, reversed onto the output
def basic.one source · line 298 · raw
@+cc:Char -> @out:List<&2, Char> -> List<&2, Char>
one character of a basic string
def basic.go source · line 303 · raw
@cs:List<&2, Char> -> @out:List<&2, Char> -> List<&2, Char>
the escaped characters of a basic string, reversed
def buf.str.go source · line 311 · raw
@buf:List<&2, Char> -> @acc:String -> String
the buffer is reversed, so each head goes on the front of the text
def buf.str source · line 319 · raw
@buf:List<&2, Char> -> String
the buffer, in order
def key.basic source · line 323 · raw
@+ss:String -> String
a basic string: quotes, with controls and quotes escaped
def key.go source · line 327 · raw
@ok:Bool -> @+ss:String -> String
bare when the name allows it, otherwise a basic string
def key source · line 335 · raw
@+ss:String -> String
a key as TOML writes it
def dec.carry.c0 source · line 339 · raw
@zz:Bool -> @cc:U32 -> List<&2, U32>
the overflow of a decimal step, least-significant digit first
def dec.carry.c source · line 347 · raw
@+cc:U32 -> List<&2, U32>
the overflow of a decimal step
def dec.carry.b0 source · line 351 · raw
@zz:Bool -> @+cc:U32 -> List<&2, U32>
the next digit of an overflow
def dec.carry.b source · line 359 · raw
@+cc:U32 -> List<&2, U32>
the next digit of an overflow
def dec.carry.a source · line 363 · raw
@zz:Bool -> @+cc:U32 -> List<&2, U32>
the first digit of an overflow
def dec.carry source · line 371 · raw
@+cc:U32 -> List<&2, U32>
the digits of a leftover carry
def dec.go source · line 375 · raw
@ds:List<&2, U32> -> @+radix:U32 -> @+carry:U32 -> List<&2, U32>
multiply a decimal numeral by a radix and add a digit
def dec.ch source · line 384 · raw
@dd:U32 -> Char
a digit character
def dec.chars source · line 388 · raw
@ds:List<&2, U32> -> List<&2, Char>
digits as characters, in the order given
def dec.drop.lead source · line 396 · raw
@lead:Bool -> @+hh:Char -> Bool
whether a leading zero is still being skipped
def dec.drop.outz source · line 404 · raw
@zz:Bool -> @hh:Char -> @out:List<&2, Char> -> List<&2, Char>
a leading zero is skipped; any other character is kept
def dec.drop.out source · line 412 · raw
@lead:Bool -> @+hh:Char -> @out:List<&2, Char> -> List<&2, Char>
the output after one character, reversed
def dec.drop.end source · line 420 · raw
@lead:Bool -> @out:List<&2, Char> -> String
the numeral, or 0 when every digit was zero
def dec.drop source · line 428 · raw
@cs:List<&2, Char> -> @+lead:Bool -> @out:List<&2, Char> -> String
drop leading zeros from a most-significant-first digit list
def dec.text source · line 436 · raw
@ds:List<&2, U32> -> String
a decimal numeral. The digit list is least-significant first
def dig.up source · line 440 · raw
@ok:Bool -> @uu:U32 -> U32
a code point's digit value, or 99 when the character is not a digit
def dig.low source · line 448 · raw
@ok:Bool -> @+uu:U32 -> U32
a lowercase hex digit, otherwise an uppercase one
def dig.dec source · line 456 · raw
@ok:Bool -> @+uu:U32 -> U32
a decimal digit, otherwise a hex letter
def dig.val source · line 464 · raw
@+cc:Char -> U32
the value of a digit character, or 99
def dig.ok source · line 469 · raw
@dd:U32 -> @base:U32 -> Bool
whether a digit value fits a base
def take.acc.d source · line 473 · raw
@digit:Bool -> @nn:U32 -> @+cc:Char -> U32
exactly k digits, or DigBad
def take.acc source · line 481 · raw
@ok:Bool -> @nn:U32 -> @+cc:Char -> U32
the accumulator after one character
def take.ok source · line 489 · raw
@ok:Bool -> @+cc:Char -> Bool
the scan stays well only while every character is a digit
def take.fin source · line 497 · raw
@ok:Bool -> @nn:U32 -> @cs:List<&2, Char> -> Dig
the finished take
def take.n source · line 505 · raw
@kk:Nat -> @cs:List<&2, Char> -> @nn:U32 -> @+ok:Bool -> Dig
exactly k digits from the front of a list
def bound.rng source · line 517 · raw
@+nn:U32 -> @lo:U32 -> @hi:U32 -> Bool
a number is inside the inclusive bounds
def pad2.go source · line 521 · raw
@small:Bool -> @nn:U32 -> String
two digits, zero padded
def text.pad2 source · line 529 · raw
@+nn:U32 -> String
two digits, zero padded
def pad4.big source · line 533 · raw
@nn:U32 -> @big:Bool -> String
the one-zero pad, or the digits themselves
def pad4.mid source · line 541 · raw
@nn:U32 -> @mid:Bool -> @big:Bool -> String
the three-digit and two-digit pads
def pad4.go source · line 549 · raw
@nn:U32 -> @small:Bool -> @mid:Bool -> @big:Bool -> String
four digits, zero padded
def text.pad4 source · line 557 · raw
@+nn:U32 -> String
four digits, zero padded
def zone.mark source · line 561 · raw
@sign:Sign -> String
the sign of a zone offset
def zone.shift source · line 569 · raw
@sign:Sign -> @hh:U32 -> @mi:U32 -> String
a numeric zone offset
def zone.text source · line 573 · raw
@zz:Zone -> String
a zone suffix
def clock.frac.go source · line 581 · raw
@empty:Bool -> @frac:String -> String
the fractional second, or nothing
def clock.frac source · line 589 · raw
@+frac:String -> String
the fractional second, or nothing
def clock.text source · line 593 · raw
@cc:Clock -> String
a clock, with a fractional second when it has one
def date.text source · line 598 · raw
@dd:Date -> String
a date
def when.text source · line 603 · raw
@ww:When -> String
a datetime in TOML spelling
def sign.text source · line 615 · raw
@sign:Sign -> String
the sign of an integer or a float, empty when it is positive
def cs.some source · line 623 · raw
@cs:List<&2, Char> -> Bool
whether the list still has a character
def cs.head source · line 631 · raw
@cs:List<&2, Char> -> Char
one character, when the list has one
def cs.tail source · line 639 · raw
@cs:List<&2, Char> -> List<&2, Char>
the tail of a list
def clock.with source · line 647 · raw
@cc:Clock -> @frac:String -> Clock
a clock with its fraction filled in
def when.done source · line 652 · raw
@_date:Date -> @_clock:Clock -> @ww:When -> WhenOut
a finished local datetime, or one with a zone still to read
def when.zone.z source · line 656 · raw
@tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
Z ends the token
def when.zone.mm.ok2 source · line 664 · raw
@mi_ok:Bool -> @sign:Sign -> @hh:U32 -> @mi:U32 -> @clock:Clock -> @date:Date -> WhenOut
the offset minute is in range
def when.zone.mm.ok source · line 672 · raw
@h_ok:Bool -> @mi_ok:Bool -> @sign:Sign -> @hh:U32 -> @mi:U32 -> @clock:Clock -> @date:Date -> WhenOut
the offset fields are in range
def when.zone.mm.end source · line 680 · raw
@cs:List<&2, Char> -> @h_ok:Bool -> @mi_ok:Bool -> @sign:Sign -> @hh:U32 -> @mi:U32 -> @clock:Clock -> @date:Date -> WhenOut
nothing follows an offset, and its fields are in range
def when.zone.mm.go source · line 697 · raw
@dd:Dig -> @sign:Sign -> @+hh:U32 -> @clock:Clock -> @date:Date -> WhenOut
the offset minute is in range
def when.zone.mm source · line 705 · raw
@hit:Bool -> @dd:Dig -> @sign:Sign -> @hh:U32 -> @clock:Clock -> @date:Date -> WhenOut
the offset minute
def when.zone.hh.colon source · line 713 · raw
@cs:List<&2, Char> -> @sign:Sign -> @hh:U32 -> @clock:Clock -> @date:Date -> WhenOut
the colon in an offset
def when.zone.hh source · line 721 · raw
@dd:Dig -> @sign:Sign -> @clock:Clock -> @date:Date -> WhenOut
the offset hour
def when.zone.off source · line 729 · raw
@sign:Sign -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
HH:MM of a numeric offset
def when.zone.minus source · line 733 · raw
@minus:Bool -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
a minus starts a numeric offset
def when.zone.sign source · line 741 · raw
@plus:Bool -> @minus:Bool -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
a plus or a minus starts a numeric offset
def when.zone.go source · line 749 · raw
@zee:Bool -> @plus:Bool -> @minus:Bool -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
Z, or a signed numeric offset
def when.zone source · line 757 · raw
@cs:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
a zone, or the end of a local datetime
def when.frac.end.go source · line 766 · raw
@some:Bool -> @rev:List<&2, Char> -> @clock:Clock -> @date:Date -> @rest:List<&2, Char> -> WhenOut
the fraction must hold a digit
def when.frac.end source · line 775 · raw
@+rev:List<&2, Char> -> @clock:Clock -> @date:Date -> @rest:List<&2, Char> -> WhenOut
the fraction must hold a digit
def when.frac.digit source · line 779 · raw
@digit:Bool -> @+cc:Char -> @tt:List<&2, Char> -> @rev:List<&2, Char> -> @clock:Clock -> @date:Date -> @more:(@_:Unit -> WhenOut) -> WhenOut
one fractional digit, or the end of the fraction
def when.frac.digits source · line 795 · raw
@cs:List<&2, Char> -> @+rev:List<&2, Char> -> @+clock:Clock -> @+date:Date -> WhenOut
fractional digits
def when.frac.go source · line 804 · raw
@dot:Bool -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> @+cc:Char -> WhenOut
a dot starts a fraction; anything else is a zone
def when.frac source · line 812 · raw
@cs:List<&2, Char> -> @+clock:Clock -> @+date:Date -> WhenOut
an optional fractional second
def when.clock.range.s source · line 820 · raw
@s_ok:Bool -> @hh:U32 -> @mi:U32 -> @ss:U32 -> @cs:List<&2, Char> -> @date:Date -> WhenOut
the second is in range, then the fraction and the zone
def when.clock.range.m source · line 828 · raw
@mi_ok:Bool -> @s_ok:Bool -> @hh:U32 -> @mi:U32 -> @ss:U32 -> @cs:List<&2, Char> -> @date:Date -> WhenOut
minute and second are in range
def when.clock.range source · line 836 · raw
@h_ok:Bool -> @mi_ok:Bool -> @s_ok:Bool -> @hh:U32 -> @mi:U32 -> @ss:U32 -> @cs:List<&2, Char> -> @date:Date -> WhenOut
hour, minute, and second are in range
def when.clock.ss.go source · line 853 · raw
@dd:Dig -> @+hh:U32 -> @+mi:U32 -> @date:Date -> WhenOut
seconds, then an optional fraction and zone
def when.clock.ss source · line 862 · raw
@hit:Bool -> @dd:Dig -> @hh:U32 -> @mi:U32 -> @date:Date -> WhenOut
seconds after the colon
def when.clock.mm.colon source · line 870 · raw
@cs:List<&2, Char> -> @hh:U32 -> @mi:U32 -> @date:Date -> WhenOut
the colon after the minutes
def when.clock.mm source · line 878 · raw
@dd:Dig -> @hh:U32 -> @date:Date -> WhenOut
minutes, then seconds
def when.clock.colon.go source · line 886 · raw
@hit:Bool -> @hh:U32 -> @tt:List<&2, Char> -> @date:Date -> WhenOut
the colon after the hour
def when.clock.colon source · line 894 · raw
@cs:List<&2, Char> -> @hh:U32 -> @date:Date -> WhenOut
the colon after the hour
def when.clock.of source · line 902 · raw
@dd:Dig -> @date:Date -> WhenOut
a clock following a date
def when.after.sp source · line 910 · raw
@sp:Bool -> @date:Date -> @tt:List<&2, Char> -> WhenOut
a space separates a date from a time
def when.after.sep source · line 918 · raw
@tee:Bool -> @sp:Bool -> @date:Date -> @tt:List<&2, Char> -> WhenOut
T or a space separates a date from a time
def when.after.date source · line 926 · raw
@date:Date -> @cs:List<&2, Char> -> WhenOut
the character after a date: nothing, T, or a space, and then a time
def when.date.ok.d source · line 935 · raw
@d_ok:Bool -> @yy:U32 -> @mo:U32 -> @dd:U32 -> @cs:List<&2, Char> -> WhenOut
the day is in range, then the rest of the token is a time or nothing
def when.date.ok.go source · line 943 · raw
@mo_ok:Bool -> @d_ok:Bool -> @yy:U32 -> @mo:U32 -> @dd:U32 -> @cs:List<&2, Char> -> WhenOut
a date whose fields are in range
def when.feb.quad source · line 952 · raw
@four_hundred:Bool -> U32
February in a year divisible by 4 and by 100: 29 days only when the year is also divisible by 400
def when.feb.cent source · line 960 · raw
@hundred:Bool -> @four_hundred:Bool -> U32
February in a year divisible by 4: 29 days unless the year is a century
def when.feb.go source · line 969 · raw
@four:Bool -> @hundred:Bool -> @four_hundred:Bool -> U32
February: 29 days in a leap year and 28 otherwise. A leap year is divisible by 4, except by 100 unless also by 400 (RFC 3339, Appendix C)
def when.feb source · line 977 · raw
@+yy:U32 -> U32
the days of February in a year
def when.short source · line 982 · raw
@+mo:U32 -> Bool
April, June, September and November have 30 days
def when.days.short source · line 987 · raw
@short:Bool -> U32
30 days in a short month and 31 in the others
def when.days.go source · line 995 · raw
@feb:Bool -> @short:Bool -> @+yy:U32 -> U32
the days of a month, by whether it is February or a short month
def when.days source · line 1003 · raw
@+yy:U32 -> @+mo:U32 -> U32
the days of month mo in year yy
def when.date.ok source · line 1007 · raw
@+yy:U32 -> @+mo:U32 -> @+dd:U32 -> @cs:List<&2, Char> -> WhenOut
a date whose fields are in range: the day within its month in that year
def when.time.rest source · line 1011 · raw
@tt:List<&2, Char> -> @hh:U32 -> WhenOut
a local time: HH:MM:SS, with the hour already taken
def when.time.only source · line 1015 · raw
@ww:WhenOut -> WhenOut
a local time uses a dummy date and then keeps only the clock
def when.day.end source · line 1029 · raw
@dd:Dig -> @yy:U32 -> @mo:U32 -> WhenOut
a complete date, then whatever follows it
def when.day.go source · line 1037 · raw
@hit:Bool -> @dd:Dig -> @yy:U32 -> @mo:U32 -> WhenOut
the day is two digits
def when.day source · line 1045 · raw
@cs:List<&2, Char> -> @yy:U32 -> @mo:U32 -> WhenOut
the day
def when.month.go source · line 1053 · raw
@dd:Dig -> @yy:U32 -> WhenOut
the dash after the month
def when.month source · line 1061 · raw
@hit:Bool -> @dd:Dig -> @yy:U32 -> WhenOut
the month
def when.year.dash source · line 1069 · raw
@cs:List<&2, Char> -> @yy:U32 -> WhenOut
the dash after the year
def when.year4 source · line 1077 · raw
@dd:Dig -> WhenOut
the fourth year digit, then the month
def when.year.more source · line 1085 · raw
@digit:Bool -> @nn:U32 -> @+cc:Char -> @tt:List<&2, Char> -> WhenOut
two more year digits, then a dash
def when.branch source · line 1093 · raw
@colon:Bool -> @digit:Bool -> @nn:U32 -> @+cc:Char -> @tt:List<&2, Char> -> WhenOut
a colon means a local time; another digit continues a year
def when.after2.go source · line 1101 · raw
@cs:List<&2, Char> -> @nn:U32 -> WhenOut
two digits decide a time or a date
def when.after2 source · line 1109 · raw
@dd:Dig -> WhenOut
two digits decide a time (HH:) or a date (YYYY-)
def when.read source · line 1117 · raw
@cs:List<&2, Char> -> WhenOut
a datetime token
def word.dash.hit source · line 1121 · raw
@first:Bool -> @+cc:Char -> Bool
a dash after the first character
def word.or source · line 1129 · raw
@aa:Bool -> @bb:Bool -> Bool
either flag
def word.colon source · line 1137 · raw
@cs:List<&2, Char> -> Bool
a colon anywhere in the token
def word.ee.hit source · line 1145 · raw
@+cc:Char -> Bool
e or E: an exponent, so the token is a numeral rather than a datetime
def word.ee source · line 1149 · raw
@cs:List<&2, Char> -> Bool
whether the token holds an exponent marker
def word.as_date source · line 1157 · raw
@date:Bool -> @exp:Bool -> Bool
a datetime scan only when the token is not an exponent numeral
def word.dash source · line 1165 · raw
@cs:List<&2, Char> -> @first:Bool -> Bool
a dash after the first character
def word.spec.nan3 source · line 1173 · raw
@cc:Bool -> Got
a negative nan, or not a special
def word.spec.nan2 source · line 1181 · raw
@bb:Bool -> @cc:Bool -> Got
a signed nan
def word.spec.nan source · line 1189 · raw
@aa:Bool -> @bb:Bool -> @cc:Bool -> Got
nan
def str.eq.step source · line 1197 · raw
@aa:String -> @bb:String -> @same:Bool -> Bool
character-for-character equality. a mismatch drops the rest and stops
def str.eq source · line 1207 · raw
@aa:String -> @bb:String -> Bool
the search only needs the bool, not a rebuilt copy of either string
def word.spec.inf3 source · line 1211 · raw
@cc:Bool -> @+ss:String -> Got
a negative inf, or nan
def word.spec.inf2 source · line 1219 · raw
@bb:Bool -> @cc:Bool -> @+ss:String -> Got
a signed inf, or nan
def word.spec.inf source · line 1227 · raw
@aa:Bool -> @bb:Bool -> @cc:Bool -> @+ss:String -> Got
inf, or nan
def word.spec.f source · line 1235 · raw
@hit:Bool -> @+ss:String -> Got
false, or the rest of the specials
def word.spec.t source · line 1243 · raw
@hit:Bool -> @other:Bool -> @+ss:String -> Got
true, or the rest of the specials
def word.spec source · line 1251 · raw
@+ss:String -> Got
true, false, inf, and nan, including a sign on inf and nan
def word.from.when source · line 1255 · raw
@ww:WhenOut -> Got
a datetime result as a value
def word.body.put.sign source · line 1265 · raw
@is_sign:Bool -> @cc:Char -> @out:List<&2, Char> -> List<&2, Char>
the spelling of a numeral with the leading sign and underscores removed
def word.body.put.us source · line 1273 · raw
@is_us:Bool -> @cc:Char -> @out:List<&2, Char> -> List<&2, Char>
an underscore is dropped; every other character is kept
def word.body.put source · line 1281 · raw
@lead:Bool -> @+cc:Char -> @out:List<&2, Char> -> List<&2, Char>
one character of a numeral spelling
def word.body.go source · line 1289 · raw
@cs:List<&2, Char> -> @lead:Bool -> @out:List<&2, Char> -> List<&2, Char>
the spelling, reversed, then put back in order at the end
def word.body source · line 1297 · raw
@cs:List<&2, Char> -> String
the spelling of a numeral with the leading sign and underscores removed
def num.start source · line 1301 · raw
Num
a fresh numeral scan
def num.bad source · line 1305 · raw
@_st:Num -> @why:String -> Num
a scan that has failed
def num.sign source · line 1309 · raw
@_st:Num -> @sign:Sign -> Num
set the sign and wait for a digit
def num.digit.ok source · line 1313 · raw
@ok:Bool -> @+cc:Char -> @nk:NK -> @sign:Sign -> @+base:U32 -> @ds:List<&2, U32> -> Num
a digit that fits the base
def num.digit.go source · line 1321 · raw
@st:Num -> @+cc:Char -> @nk:NK -> Num
a decimal digit joined to the numeral
def num.digit source · line 1326 · raw
@st:Num -> @+cc:Char -> @nk:NK -> Num
a decimal digit joined to the numeral
def num.us.go source · line 1330 · raw
@ok:Bool -> @nk:NK -> @sign:Sign -> @base:U32 -> @ds:List<&2, U32> -> @why:String -> Num
an underscore between digits
def num.us source · line 1338 · raw
@st:Num -> Num
an underscore between digits
def num.base source · line 1343 · raw
@st:Num -> @base:U32 -> Num
the base prefix after a leading zero
def num.dot.go source · line 1348 · raw
@ok:Bool -> @sign:Sign -> Num
a dot begins the fraction
def num.dot source · line 1356 · raw
@st:Num -> Num
a dot begins the fraction
def num.exp.go source · line 1361 · raw
@ok:Bool -> @sign:Sign -> Num
an exponent marker
def num.exp source · line 1369 · raw
@st:Num -> Num
an exponent marker
def num.sign.of source · line 1374 · raw
@st:Num -> Sign
the sign already chosen
def num.lead.digit source · line 1379 · raw
@digit:Bool -> @st:Num -> @+cc:Char -> Num
a first digit
def num.lead.zero source · line 1387 · raw
@zero:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
a leading zero, or another digit
def num.lead.minus source · line 1395 · raw
@minus:Bool -> @zero:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
a minus, a zero, or a digit
def num.lead.go source · line 1403 · raw
@plus:Bool -> @minus:Bool -> @zero:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
a sign, a zero, or a digit
def num.lead source · line 1411 · raw
@st:Num -> @+cc:Char -> Num
the first character after an optional sign
def num.after.sign.go source · line 1417 · raw
@twice:Bool -> @sign:Sign -> @+cc:Char -> Num
a second sign is refused; any other character is read as the first one of an unsigned numeral, with the sign kept
def num.after.sign source · line 1425 · raw
@st:Num -> @+cc:Char -> Num
the character after a sign
def num.zero.exp2 source · line 1430 · raw
@ee:Bool -> @st:Num -> @_c:Char -> Num
a capital exponent; any other character is refused, since a digit or an
underscore after a leading zero (01, 0_1) would hide it
def num.zero.exp source · line 1438 · raw
@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an exponent after zero, or a rejected extra digit
def num.zero.dot source · line 1446 · raw
@dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a fraction or an exponent after zero
def num.zero.b source · line 1454 · raw
@bb:Bool -> @dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a binary prefix, or a float
def num.zero.o source · line 1462 · raw
@oo:Bool -> @bb:Bool -> @dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an octal prefix, or the rest
def num.zero.go source · line 1470 · raw
@xx:Bool -> @oo:Bool -> @bb:Bool -> @dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a base prefix, a fraction, or an exponent
def num.zero source · line 1478 · raw
@st:Num -> @+cc:Char -> Num
the character after a lone zero
def num.digs.exp2 source · line 1483 · raw
@ee:Bool -> @st:Num -> @_c:Char -> Num
a capital exponent, or a rejected character
def num.digs.exp source · line 1491 · raw
@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an exponent
def num.digs.dot source · line 1499 · raw
@dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a dot or an exponent
def num.digs.us source · line 1507 · raw
@us:Bool -> @dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an underscore, a dot, or an exponent
def num.digs.go source · line 1515 · raw
@digit:Bool -> @us:Bool -> @dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a decimal digit, an underscore, a dot, or an exponent
def num.digs source · line 1523 · raw
@st:Num -> @+cc:Char -> Num
a decimal digit, an underscore, a dot, or an exponent
def num.based.go source · line 1528 · raw
@us:Bool -> @st:Num -> @+cc:Char -> Num
an underscore, or a digit of the base
def num.based source · line 1536 · raw
@st:Num -> @+cc:Char -> Num
a digit of a prefixed integer, or an underscore
def num.frac.exp2 source · line 1540 · raw
@ee:Bool -> @st:Num -> @_c:Char -> Num
a capital exponent, or a rejected character
def num.frac.exp source · line 1548 · raw
@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an exponent in a fraction
def num.frac.us source · line 1556 · raw
@us:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an underscore or an exponent in a fraction
def num.frac.go source · line 1564 · raw
@digit:Bool -> @us:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a fraction digit, an underscore, or an exponent
def num.frac source · line 1572 · raw
@st:Num -> @+cc:Char -> Num
a fraction digit, an underscore, or an exponent
def num.exp.sign source · line 1577 · raw
@st:Num -> Num
the exponent sign is part of the spelling; digits follow
def num.expon.digit source · line 1582 · raw
@digit:Bool -> @st:Num -> @+cc:Char -> Num
a digit of the exponent
def num.expon.minus source · line 1590 · raw
@minus:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
a minus or a digit in an exponent
def num.expon.go source · line 1598 · raw
@plus:Bool -> @minus:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
the sign or the first digit of an exponent
def num.expon source · line 1606 · raw
@st:Num -> @+cc:Char -> Num
the sign or the first digit of an exponent
def num.edig.us source · line 1610 · raw
@us:Bool -> @st:Num -> @_c:Char -> Num
an underscore in an exponent
def num.edig.go source · line 1618 · raw
@digit:Bool -> @us:Bool -> @st:Num -> @+cc:Char -> Num
an exponent digit or an underscore
def num.edig source · line 1626 · raw
@st:Num -> @+cc:Char -> Num
an exponent digit or an underscore
def num.on source · line 1630 · raw
@nk:NK -> @st:Num -> @+cc:Char -> Num
one character of a numeral
def num.step.go source · line 1652 · raw
@st:Num -> @+cc:Char -> Num
one character of a numeral
def num.step source · line 1657 · raw
@st:Num -> @+cc:Char -> Num
one character of a numeral
def num.go source · line 1661 · raw
@cs:List<&2, Char> -> @st:Num -> Num
the walk over a numeral
def i64.limit source · line 1669 · raw
@sign:Sign -> String
the positive limit is 2^63-1; the negative limit is 2^63
def i64.ord source · line 1677 · raw
@seen:Cmp -> @now:Cmp -> Cmp
the first differing digit stands; a tie takes the new order
def i64.step source · line 1688 · raw
@+digits:String -> @+limit:String -> @ord:Cmp -> Bool
a shorter digit string fits and a longer one does not. equal length uses digit order. the walk does not rebuild either string
def i64.fits source · line 1700 · raw
@+sign:Sign -> @+digits:String -> Bool
whether the integer fits in a signed 64-bit integer
def num.fin.range source · line 1704 · raw
@ok:Bool -> @sign:Sign -> @digits:String -> Got
an integer inside the signed 64-bit range
def num.fin.int source · line 1712 · raw
@saw:Bool -> @+sign:Sign -> @+digits:String -> Got
a finished integer, rejected when it falls outside signed 64-bit
def num.fin.saw source · line 1720 · raw
@saw:Bool -> @val:Val -> Got
a numeral needs a digit in its last run
def num.signed source · line 1728 · raw
@cs:List<&2, Char> -> Bool
a prefixed integer may not carry a sign
def num.fin.base source · line 1736 · raw
@signed:Bool -> @saw:Bool -> @sign:Sign -> @ds:List<&2, U32> -> Got
a prefixed integer, rejected when a sign was written
def num.fin.nk source · line 1744 · raw
@nk:NK -> @sign:Sign -> @ds:List<&2, U32> -> @saw:Bool -> @why:String -> @cs:List<&2, Char> -> Got
the kind of numeral the scan finished in
def num.fin.us source · line 1766 · raw
@us:Bool -> @nk:NK -> @sign:Sign -> @ds:List<&2, U32> -> @saw:Bool -> @why:String -> @cs:List<&2, Char> -> Got
a trailing underscore is rejected
def num.fin source · line 1774 · raw
@st:Num -> @cs:List<&2, Char> -> Got
the value of a finished numeral
def word.num source · line 1779 · raw
@+cs:List<&2, Char> -> Got
a numeral token
def word.route.date source · line 1783 · raw
@date:Bool -> @cs:List<&2, Char> -> Got
a datetime when the token has a colon or a dash, otherwise a numeral
def word.route source · line 1791 · raw
@gg:Got -> @date:Bool -> @+cs:List<&2, Char> -> Got
a special word, or a numeral
def word.special.minus source · line 1799 · raw
@+cc:Char -> Bool
'-' can start a signed inf or nan
def word.special.plus source · line 1803 · raw
@hit:Bool -> @+cc:Char -> Bool
'+' or '-'
def word.special.n source · line 1811 · raw
@hit:Bool -> @+cc:Char -> Bool
'n', or a sign
def word.special.i source · line 1819 · raw
@hit:Bool -> @+cc:Char -> Bool
'i', or nan, or a sign
def word.special.f source · line 1827 · raw
@hit:Bool -> @+cc:Char -> Bool
'f', or inf, or nan, or a sign
def word.special.t source · line 1835 · raw
@hit:Bool -> @+cc:Char -> Bool
't', or false, or inf, or nan, or a sign
def word.special source · line 1843 · raw
@+cc:Char -> Bool
whether this character can start a special bare word
def word.lead source · line 1847 · raw
@cs:List<&2, Char> -> Bool
the first character, when the word has one
def word.val.num source · line 1855 · raw
@+cs:List<&2, Char> -> Got
a numeral or a datetime. the token cannot be a keyword
def word.val.pick source · line 1859 · raw
@special:Bool -> @+cs:List<&2, Char> -> Got
a special word, or a numeral. a digit does not build a string to compare
def word.val source · line 1868 · raw
@+cs:List<&2, Char> -> Got
a bare word: a special, a datetime, or a numeral
def err.first.go source · line 1906 · raw
@empty:Bool -> @bad:String -> @why:String -> String
the first error is kept
def err.first source · line 1914 · raw
@+bad:String -> @why:String -> String
the first error is kept
def find.step source · line 1918 · raw
@eq:Bool -> @vv:Val -> @more:(@_:Unit -> Hit) -> Hit
a key found earlier wins
def rows.find source · line 1926 · raw
@rows:List<&2, Val> -> @+name:String -> Hit
the first pair of this name
def get source · line 1936 · raw
@rows:List<&2, Val> -> @+name:String -> Hit
the value written for a key, or Miss
def rows.repl.step source · line 1940 · raw
@eq:Bool -> @nn:String -> @old:Val -> @val:Val -> @more:(@_:Unit -> List<&2, Val>) -> List<&2, Val>
replace the value of one pair
def rows.repl source · line 1948 · raw
@rows:List<&2, Val> -> @+name:String -> @+val:Val -> List<&2, Val>
replace every pair of this name
def heads.or source · line 1958 · raw
@aa:Bool -> @bb:Bool -> Bool
either flag
def heads.by.head source · line 1967 · raw
@path:String -> String
heads records each table the document has defined as its path behind one
mark: [ when a header defined it, . when dotted keys did
def heads.by.dot source · line 1971 · raw
@path:String -> String
a table dotted keys defined, as heads records it
def heads.has source · line 1975 · raw
@hs:List<&2, String> -> @+pp:String -> Bool
whether a table path was defined, by a header or by dotted keys
def heads.head source · line 1985 · raw
@hs:List<&2, String> -> @+pp:String -> Bool
whether a table path was defined by a header
def heads.drop.step source · line 1995 · raw
@under:Bool -> @mark:Char -> @path:String -> @rest:List<&2, String> -> List<&2, String>
a recorded table under the prefix is dropped
def heads.drop source · line 2009 · raw
@hs:List<&2, String> -> @+pre:String -> List<&2, String>
forget every table whose path starts with the prefix. A new element of an array of tables starts with none of the tables the element before defined
def heads.define.new source · line 2019 · raw
@seen:Bool -> @path:String -> @heads:List<&2, String> -> List<&2, String>
a table defined by a dotted key is recorded once
def heads.define source · line 2027 · raw
@job:Job -> @+path:String -> @+heads:List<&2, String> -> List<&2, String>
a dotted key defines each table before its last segment
def tree.pre.go source · line 2035 · raw
@empty:Bool -> @pre:String -> @name:String -> String
a dotted path from a prefix and one segment
def tree.pre source · line 2043 · raw
@+pre:String -> @name:String -> String
a dotted path from a prefix and one segment
def look.of source · line 2047 · raw
@vv:Val -> Look
the value a key already holds
def look.step source · line 2059 · raw
@eq:Bool -> @vv:Val -> @more:(@_:Unit -> Look) -> Look
the matching pair, or the rest of the table
def rows.look source · line 2067 · raw
@rows:List<&2, Val> -> @+name:String -> Look
what a key in this table refers to
def look.last.one source · line 2077 · raw
@vv:Val -> @path:String -> @older:List<&2, Val> -> Last
the newest element. rows stay newest-first until the document is sealed
def look.last source · line 2085 · raw
@elems:List<&2, Val> -> @path:String -> Last
the newest element of an array of tables, and the older elements behind it
def tree.wrap source · line 2095 · raw
@fr:Fr -> @child:List<&2, Val> -> List<&2, Val>
put the child rows back into the parent table. A new implicit table is consed, not copied on. Inside an inline table it is a table too until the inline table closes, so the next dotted key can go on in it (inl.seal)
def tree.rebuild source · line 2105 · raw
@stack:List<&2, Fr> -> @vs:List<&2, Val> -> @bad:String -> @heads:List<&2, String> -> End
walk the frames back to the root
def tree.leaf.put source · line 2113 · raw
@hit:Hit -> @name:String -> @vs:List<&2, Val> -> @val:Val -> @stack:List<&2, Fr> -> @bad:String -> @heads:List<&2, String> -> End
a key that is already present is a duplicate
def tree.leaf.def.head source · line 2129 · raw
@seen:Bool -> @name:String -> @vs:List<&2, Val> -> @rows:List<&2, Val> -> @stack:List<&2, Fr> -> @bad:String -> @+path:String -> @heads:List<&2, String> -> End
an explicit header for a table that already exists
def tree.leaf.def.hit source · line 2147 · raw
@hit:Look -> @name:String -> @vs:List<&2, Val> -> @stack:List<&2, Fr> -> @bad:String -> @+path:String -> @+heads:List<&2, String> -> End
open a standard table
def tree.leaf.def source · line 2171 · raw
@hit:Look -> @+name:String -> @vs:List<&2, Val> -> @stack:List<&2, Fr> -> @bad:String -> @pre:String -> @heads:List<&2, String> -> End
open a standard table
def tree.leaf.aot.hit source · line 2183 · raw
@hit:Look -> @name:String -> @vs:List<&2, Val> -> @stack:List<&2, Fr> -> @bad:String -> @+path:String -> @heads:List<&2, String> -> End
append one element of an array of tables
def tree.leaf.aot source · line 2206 · raw
@hit:Look -> @+name:String -> @vs:List<&2, Val> -> @stack:List<&2, Fr> -> @bad:String -> @pre:String -> @heads:List<&2, String> -> End
append one element of an array of tables
def tree.leaf.job source · line 2218 · raw
@job:Job -> @+name:String -> @+vs:List<&2, Val> -> @stack:List<&2, Fr> -> @bad:String -> @pre:String -> @heads:List<&2, String> -> End
the key at the end of the path
def tree.leaf.bad source · line 2236 · raw
@ok:Bool -> @name:String -> @vs:List<&2, Val> -> @job:Job -> @stack:List<&2, Fr> -> @bad:String -> @pre:String -> @heads:List<&2, String> -> End
a failed walk rebuilds what it has
def tree.leaf source · line 2253 · raw
@name:String -> @tw:Tw -> End
the key at the end of the path
def tree.sub.aots source · line 2262 · raw
@last:Last -> @+name:String -> @+vs:List<&2, Val> -> @walk:Walk -> @path:String -> Tw
enter the last element of an array of tables
def tree.sub.job source · line 2279 · raw
@mark:Bool -> @job:Job -> Job
a prefix of the current table is navigation; a dotted segment defines a table
def tree.sub.dot source · line 2287 · raw
@job:Job -> Bool
a segment of a dotted key, which defines tables as it goes
def tree.sub.head.go source · line 2295 · raw
@shut:Bool -> @path:String -> @rows:List<&2, Val> -> @+name:String -> @vs:List<&2, Val> -> @walk:Walk -> @mark:Bool -> Tw
enter a table, unless a dotted key would add to a table a header defined
def tree.sub.head source · line 2314 · raw
@dot:Bool -> @path:String -> @rows:List<&2, Val> -> @+name:String -> @vs:List<&2, Val> -> @walk:Walk -> @mark:Bool -> Tw
a dotted key asks whether a header defined the table; a header walk does not
def tree.sub.arr source · line 2333 · raw
@dot:Bool -> @+path:String -> @elems:List<&2, Val> -> @+name:String -> @+vs:List<&2, Val> -> @walk:Walk -> Tw
a header enters the last element of an array of tables; a dotted key cannot add to an array of tables
def tree.sub.look source · line 2349 · raw
@hit:Look -> @+name:String -> @+vs:List<&2, Val> -> @walk:Walk -> @+mark:Bool -> Tw
descend into one key, or record why it cannot be entered
def tree.sub.bad source · line 2378 · raw
@ok:Bool -> @+name:String -> @+vs:List<&2, Val> -> @bad:String -> @walk:Walk -> @mark:Bool -> Tw
descend into one key when the walk is still well
def tree.sub source · line 2394 · raw
@name:String -> @tw:Tw -> @mark:Bool -> Tw
descend into one key
def path.len source · line 2400 · raw
@xs:List<&2, String> -> @nn:U32 -> U32
how many segments are already the current table
def path.dec.z source · line 2408 · raw
@zz:Bool -> @skip:U32 -> U32
one fewer prefix segment, staying at zero
def path.dec source · line 2416 · raw
@+skip:U32 -> U32
one fewer prefix segment, staying at zero
def tree.walk.none source · line 2420 · raw
@tw:Tw -> End
an empty path records an error
def tree.walk source · line 2425 · raw
@path:List<&2, String> -> @tw:Tw -> @+skip:U32 -> End
follow a key path and apply the job at its end. skip is the current table
def ch.sp source · line 2437 · raw
@+cc:Char -> Bool
space or tab
def ch.space source · line 2441 · raw
@+cc:Char -> Bool
the space character itself, U+0020, the only one a datetime may hold
def ch.nl source · line 2445 · raw
@+cc:Char -> Bool
line feed or carriage return
def ch.ctl source · line 2449 · raw
@+cc:Char -> Bool
a control: U+0000 to U+001F, or U+007F
def ch.delim source · line 2453 · raw
@+cc:Char -> Bool
a character that ends a bare value
def ch.skip source · line 2458 · raw
@+cc:Char -> Bool
whitespace that a bare value swallows
def q.char source · line 2462 · raw
@kk:QKind -> Char
the quote character of a string kind
def q.multi source · line 2472 · raw
@kk:QKind -> Bool
a multiline string
def q.basic source · line 2482 · raw
@kk:QKind -> Bool
a basic string, which has escapes
def q.as.multi source · line 2492 · raw
@kk:QKind -> QKind
the multiline kind of a one-line kind
def date.mode source · line 2500 · raw
@pp:Char -> Bool
a pattern character that stands for a digit
def date.eq.go source · line 2504 · raw
@ok:Bool -> @more:(@_:Unit -> Bool) -> Bool
whether the rest of the shape matches
def date.step source · line 2512 · raw
@mode:Bool -> @digit:Bool -> @same:Bool -> @more:(@_:Unit -> Bool) -> Bool
one character of a date shape
def date.eq.nil source · line 2520 · raw
@pat:List<&2, Char> -> Bool
both lists ended together
def date.eq source · line 2528 · raw
@cs:List<&2, Char> -> @pat:List<&2, Char> -> Bool
YYYY-MM-DD, with D standing for a digit
def date.shaped source · line 2541 · raw
@buf:List<&2, Char> -> Bool
the buffer is a calendar date
def span.str source · line 2545 · raw
@src:String -> @+nn:U32 -> @zz:Bool -> String
the first n characters of a source span
def span.rev source · line 2555 · raw
@src:String -> @+nn:U32 -> @zz:Bool -> @acc:List<&2, Char> -> List<&2, Char>
the first n characters, reversed, so an escape can keep copying
def span.drop source · line 2565 · raw
@src:String -> Unit
the unread suffix of a span that will not be stored
def path.cat source · line 2573 · raw
@here:List<&2, String> -> @parts:List<&2, String> -> List<&2, String>
the key path, document table then this key
def str.bad.nl source · line 2577 · raw
@nl:Bool -> @multi:Bool -> Bool
a multiline string keeps a newline
def str.bad.tab source · line 2585 · raw
@tab:Bool -> @nl:Bool -> @multi:Bool -> Bool
tab is kept
def str.bad.go source · line 2593 · raw
@ctrl:Bool -> @tab:Bool -> @nl:Bool -> @multi:Bool -> Bool
a raw control is rejected
def str.bad source · line 2601 · raw
@+uu:U32 -> @multi:Bool -> Bool
a raw control is rejected. Tab is kept. A multiline string also keeps newlines
def st.err source · line 2606 · raw
@st:St -> @why:String -> St
the scanner has failed
def st.lex source · line 2613 · raw
@st:St -> @lex:Lex -> St
replace the lex state
def st.hold source · line 2620 · raw
@st:St -> @+lex:Lex -> @cc:Char -> St
hold one character and set the lex state
def st.push source · line 2627 · raw
@st:St -> @cc:Char -> @lex:Lex -> St
append one character
def seg.push source · line 2634 · raw
@st:St -> @lex:Lex -> St
the segment in the buffer joins the key, and the buffer is cleared
def take.root source · line 2641 · raw
@end:End -> @here:List<&2, String> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> St
a finished value at the document root
def take.inl source · line 2660 · raw
@end:End -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @+here:List<&2, String> -> @+parts:List<&2, String> -> @rest:List<&2, Ctx> -> @keep:Keep -> St
a finished value inside an inline table
def take.top source · line 2675 · raw
@stack:List<&2, Ctx> -> @val:Val -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @+here:List<&2, String> -> @parts:List<&2, String> -> @keep:Keep -> St
place a finished value into the current table, array, or inline table
def val.take source · line 2701 · raw
@st:St -> @val:Val -> St
place a finished value
def bare.hold.on source · line 2708 · raw
@st:St -> @cc:Char -> St
hold the delimiter when the following state must see it
def bare.line.lex source · line 2716 · raw
@lex:Lex -> @st:St -> St
hold the delimiter when the following state must see it a newline that ended a root value already separates the next expression
def bare.line.go source · line 2724 · raw
@st:St -> St
a consumed newline returns to the top level after a root value
def bare.line source · line 2731 · raw
@st:St -> @nl:Bool -> St
a consumed newline returns to the top level after a root value
def bare.hold source · line 2739 · raw
@st:St -> @cc:Char -> @hold:Bool -> St
hold the delimiter when the following state must see it
def bare.got source · line 2747 · raw
@gg:Got -> @st:St -> @cc:Char -> @hold:Bool -> St
a bare word has been classified
def bare.finish source · line 2755 · raw
@st:St -> @cc:Char -> @hold:Bool -> St
finish a bare word. hold is true when the delimiter is not whitespace
def head.apply source · line 2763 · raw
@end:End -> @segs:List<&2, String> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @lead:Bool -> St
close the header that was just read
def head.job source · line 2773 · raw
@arr:Bool -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @+segs:List<&2, String> -> @hkeep:HeadKeep -> @lead:Bool -> St
an array-of-tables header, or a table header
def head.on source · line 2795 · raw
@st:St -> @segs:List<&2, String> -> St
open the table or the array of tables named by the header
def head.go source · line 2801 · raw
@empty:Bool -> @st:St -> @segs:List<&2, String> -> St
the header key is ready
def head.use source · line 2809 · raw
@st:St -> St
the segment was pushed
def head.fin.buf source · line 2817 · raw
@empty:Bool -> @st:St -> St
the buffer is the last segment when it holds one
def head.fin source · line 2825 · raw
@st:St -> St
push a trailing segment, then open the header
def arr.top source · line 2833 · raw
@stack:List<&2, Ctx> -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @keep:Keep -> St
close an array and place it
def arr.close source · line 2851 · raw
@st:St -> St
close an array and place it
def inl.seal source · line 2858 · raw
@rows:List<&2, Val> -> List<&2, Val>
an inline table is closed once written: the tables its dotted keys made, open while it was read, close with it
def inl.top source · line 2868 · raw
@stack:List<&2, Ctx> -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @keep:Keep -> St
close an inline table and place it
def inl.close source · line 2886 · raw
@st:St -> St
close an inline table and place it
def inl.open source · line 2892 · raw
@stack:List<&2, Ctx> -> Bool
the innermost frame is an inline table
def str.fin source · line 2900 · raw
@st:St -> St
a string is finished
def mq.put source · line 2907 · raw
@one:Bool -> @+qq:Char -> @buf:List<&2, Char> -> List<&2, Char>
one or two quotes that did not close a multiline string
def uni.ok source · line 2915 · raw
@+uu:U32 -> Bool
a code point may be written as a character
def uni.finish.on source · line 2920 · raw
@st:St -> @uu:U32 -> @back:Lex -> St
a finished unicode escape written into the buffer
def uni.finish source · line 2927 · raw
@ok:Bool -> @st:St -> @uu:U32 -> @back:Lex -> St
a finished unicode escape
def uni.next.more source · line 2935 · raw
@st:St -> @uu:U32 -> @left:U32 -> St
another hex digit is still required
def uni.next source · line 2942 · raw
@last:Bool -> @st:St -> @+uu:U32 -> @back:Lex -> @left:U32 -> St
the escape is finished, or another hex digit is required
def uni.go source · line 2950 · raw
@ok:Bool -> @st:St -> @+cc:Char -> @back:Lex -> @uni:U32 -> @+left:U32 -> St
one hex digit of a unicode escape
def uni.step source · line 2958 · raw
@st:St -> @+cc:Char -> @back:Lex -> St
one hex digit of a unicode escape
def esc.uu source · line 2966 · raw
@uu:Bool -> Esc
a long unicode escape, or an unknown escape
def esc.u source · line 2974 · raw
@uuu:Bool -> @uu:Bool -> Esc
a unicode escape
def esc.r source · line 2982 · raw
@rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
carriage return or a unicode escape
def esc.f source · line 2990 · raw
@ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
form feed or the rest
def esc.n source · line 2998 · raw
@nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
newline or the rest
def esc.t source · line 3006 · raw
@tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
tab, newline, form feed, carriage return, or a unicode escape
def esc.letter source · line 3014 · raw
@bb:Bool -> @tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
backslash, quotation mark, or a letter escape
def esc.sp source · line 3022 · raw
@sp:Bool -> @bb:Bool -> @tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
spaces before the newline of a line-ending backslash
def esc.fold source · line 3034 · raw
@nl:Bool -> @sp:Bool -> @letters:Letters -> Esc
a line-ending backslash, or a letter
def esc.bs source · line 3043 · raw
@bs:Bool -> @letters:Letters -> @nl:Bool -> @sp:Bool -> Esc
a backslash or a letter
def esc.of.go source · line 3051 · raw
@qq:Bool -> @bs:Bool -> @letters:Letters -> @nl:Bool -> @sp:Bool -> Esc
a quote, a backslash, or a letter
def esc.of source · line 3059 · raw
@+cc:Char -> Esc
classify one escaped character
def esc.uni.lex source · line 3065 · raw
@back:Lex -> Lex
the lex state that reads the hex digits of an escape
def esc.uni source · line 3075 · raw
@st:St -> @back:Lex -> @nn:U32 -> St
a unicode escape starts with no digits seen
def esc.fold.bit source · line 3082 · raw
@saw:Bool -> U32
1 once a newline has been seen
def esc.fold.on source · line 3090 · raw
@st:St -> @saw:Bool -> St
a line-ending backslash skips following whitespace
def esc.fold.kind source · line 3097 · raw
@multi:Bool -> @st:St -> @saw:Bool -> St
a line-ending backslash is only part of a multiline string
def esc.fold.str source · line 3105 · raw
@st:St -> @saw:Bool -> St
a line-ending backslash is only part of a multiline string
def esc.fold.use source · line 3112 · raw
@back:Lex -> @st:St -> @saw:Bool -> St
a line-ending backslash is only part of a string
def esc.use source · line 3120 · raw
@ee:Esc -> @st:St -> @back:Lex -> St
apply one escape and return to the string
def com.enter source · line 3132 · raw
@st:St -> @back:Lex -> St
the lex state a comment returns to
def lex.top.bare source · line 3139 · raw
@bare:Bool -> @st:St -> @cc:Char -> St
a bare key, or a rejected character
def lex.bracket source · line 3147 · raw
@st:St -> St
a header starts with a clear key
def lex.qkey source · line 3154 · raw
@st:St -> @kind:QKind -> @lex:Lex -> St
a quoted key starts with an empty buffer
def lex.top.lit source · line 3161 · raw
@lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
a literal key or a bare key
def lex.top.q source · line 3169 · raw
@qq:Bool -> @lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
a quoted key or a bare key
def lex.top.br source · line 3177 · raw
@br:Bool -> @qq:Bool -> @lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
a header or a key
def lex.top.hash source · line 3185 · raw
@hash:Bool -> @br:Bool -> @qq:Bool -> @lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
a comment, a header, or a key
def lex.top.nl source · line 3193 · raw
@nl:Bool -> @hash:Bool -> @br:Bool -> @qq:Bool -> @lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
a newline, a comment, a header, or a key
def lex.top.go source · line 3205 · raw
@sp:Bool -> @nl:Bool -> @hash:Bool -> @topch:TopCh -> @st:St -> @cc:Char -> St
whitespace, a comment, a header, or a key
def lex.top source · line 3214 · raw
@st:St -> @+cc:Char -> St
top level: a key, a header, a comment, or whitespace
def lex.key.nl source · line 3219 · raw
@nl:Bool -> @st:St -> @_c:Char -> St
a newline before equals is rejected
def lex.key.end.go source · line 3227 · raw
@empty:Bool -> @st:St -> @lex:Lex -> St
an empty segment is rejected
def lex.key.end source · line 3235 · raw
@st:St -> @next:Lex -> St
end a nonempty segment
def lex.key.hash source · line 3243 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment ends the segment and waits for equals
def lex.key.eq source · line 3251 · raw
@eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @+cc:Char -> St
an equals ends the key
def lex.key.dot source · line 3259 · raw
@dot:Bool -> @eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a dot ends the segment and skips whitespace before the next one
def lex.key.sp source · line 3267 · raw
@sp:Bool -> @dot:Bool -> @eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace ends the segment
def lex.key.go source · line 3275 · raw
@bare:Bool -> @sp:Bool -> @dot:Bool -> @eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a bare character, whitespace, a dot, or an equals
def lex.key source · line 3283 · raw
@st:St -> @+cc:Char -> St
inside a bare key segment
def lex.after.nl source · line 3288 · raw
@nl:Bool -> @st:St -> @_c:Char -> St
a newline before equals is rejected
def lex.after.hash source · line 3296 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment waits for equals
def lex.after.eq source · line 3304 · raw
@eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
equals starts the value
def lex.after.dot source · line 3312 · raw
@dot:Bool -> @eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a dot starts the next segment, after any whitespace
def lex.after.go source · line 3320 · raw
@sp:Bool -> @dot:Bool -> @eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace, a dot, or an equals
def lex.after source · line 3328 · raw
@st:St -> @+cc:Char -> St
after a key segment, before equals or a dot
def lex.val.nl3 source · line 3333 · raw
@inside:Bool -> @st:St -> St
a value starts on the line of its key
def lex.val.nl2 source · line 3341 · raw
@st:St -> @_c:Char -> St
a newline before a value is rejected
def lex.array source · line 3349 · raw
@st:St -> St
an array starts a frame and waits for a value
def lex.inline source · line 3356 · raw
@st:St -> St
an inline table starts a frame and waits for a key
def lex.val.inl source · line 3363 · raw
@inl:Bool -> @st:St -> @cc:Char -> St
an inline table, or a bare value
def lex.val.br source · line 3371 · raw
@br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
an array, or another value
def lex.val.lit source · line 3379 · raw
@lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
a literal string, or another value
def lex.val.q source · line 3387 · raw
@qq:Bool -> @lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
a basic string, or another value
def lex.val.hash source · line 3395 · raw
@hash:Bool -> @qq:Bool -> @lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
a comment, a string, an array, an inline table, or a bare value
def lex.val.nl source · line 3403 · raw
@nl:Bool -> @hash:Bool -> @qq:Bool -> @lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
a newline before a value is rejected
def lex.val.go source · line 3415 · raw
@sp:Bool -> @nl:Bool -> @hash:Bool -> @valch:ValCh -> @st:St -> @cc:Char -> St
whitespace or the value itself
def lex.val source · line 3424 · raw
@st:St -> @+cc:Char -> St
the start of a value
def lex.q.go source · line 3429 · raw
@same:Bool -> @st:St -> @cc:Char -> St
a second quote may start a multiline string; otherwise the first character is held
def lex.q source · line 3437 · raw
@st:St -> @+cc:Char -> St
the first quote has been seen
def lex.multi source · line 3445 · raw
@st:St -> @kind:QKind -> St
a multiline string, about to trim one opening newline
def lex.q2.go source · line 3452 · raw
@same:Bool -> @st:St -> @cc:Char -> @kind:QKind -> St
a third quote starts a multiline string; two quotes are an empty string
def lex.q2 source · line 3460 · raw
@st:St -> @+cc:Char -> St
two quotes have been seen
def lex.trim.nl source · line 3468 · raw
@nl:Bool -> @st:St -> @cc:Char -> St
a line feed is trimmed; any other character is the first of the string
def lex.trim.go source · line 3476 · raw
@cr:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a carriage return may still have a line feed after it
def lex.trim source · line 3484 · raw
@st:St -> @+cc:Char -> St
trim one opening newline of a multiline string
def lex.trim2.go source · line 3488 · raw
@lf:Bool -> @st:St -> @cc:Char -> St
the line feed of a CRLF opening newline
def lex.trim2 source · line 3496 · raw
@st:St -> @+cc:Char -> St
the line feed of a CRLF opening newline
def lex.str.char.go source · line 3500 · raw
@bad:Bool -> @st:St -> @cc:Char -> St
a forbidden control, or one character of the string
def lex.str.char source · line 3508 · raw
@multi:Bool -> @st:St -> @+cc:Char -> St
a raw character, rejected when it is a forbidden control
def lex.str.bs source · line 3512 · raw
@bs:Bool -> @multi:Bool -> @st:St -> @cc:Char -> @_kind:QKind -> St
an escape, or a plain character
def lex.str.esc source · line 3520 · raw
@basic:Bool -> @multi:Bool -> @st:St -> @+cc:Char -> @kind:QKind -> St
a backslash starts an escape in a basic string
def lex.mq source · line 3528 · raw
@st:St -> @nn:U32 -> St
count closing quotes of a multiline string
def lex.str.quote source · line 3535 · raw
@multi:Bool -> @st:St -> St
one quote closes a one-line string and may close a multiline string
def lex.str.go source · line 3543 · raw
@quote:Bool -> @multi:Bool -> @basic:Bool -> @st:St -> @+cc:Char -> @kind:QKind -> St
a quote, an escape, or a character
def lex.str source · line 3551 · raw
@st:St -> @+cc:Char -> St
inside a string
def lex.mq.shut source · line 3559 · raw
@st:St -> St
a closing delimiter has been read. up to two more quotes are still the string's
def lex.mq.one source · line 3566 · raw
@one:Bool -> @st:St -> St
the second quote waits; the third is a closing delimiter
def lex.mq.back source · line 3574 · raw
@st:St -> @cc:Char -> @buf:List<&2, Char> -> St
quotes that were not a closer return to the string, and the character is held
def lex.mq.go source · line 3581 · raw
@quote:Bool -> @one:Bool -> @st:St -> @cc:Char -> @buf:List<&2, Char> -> @kind:QKind -> @_left:U32 -> St
a quote continues the closer; anything else is content
def lex.mq.step source · line 3589 · raw
@st:St -> @+cc:Char -> St
one character while closing a multiline string
def lex.mq.more source · line 3597 · raw
@st:St -> @cc:Char -> St
a quote after the closing delimiter: the delimiter moves one quote on
def lex.mq.fin source · line 3604 · raw
@st:St -> @cc:Char -> St
the string ends before this character, which the next state reads
def lex.mq.room source · line 3608 · raw
@room:Bool -> @st:St -> @cc:Char -> St
a third quote after the delimiter would make three in the string
def lex.mq.end.go source · line 3616 · raw
@quote:Bool -> @room:Bool -> @st:St -> @cc:Char -> St
a quote may still belong to the string; anything else follows it
def lex.mq.end source · line 3624 · raw
@st:St -> @+cc:Char -> St
one character after a multiline string's closing delimiter
def lex.esc source · line 3632 · raw
@st:St -> @+cc:Char -> St
one escaped character
def lex.fold.saw source · line 3636 · raw
@st:St -> St
remember that a newline was seen
def lex.fold.end.go source · line 3643 · raw
@saw:Bool -> @st:St -> @cc:Char -> St
a character before the newline is rejected
def lex.fold.end source · line 3651 · raw
@st:St -> @cc:Char -> St
the next character ends the fold only after a newline
def lex.fold.nl source · line 3659 · raw
@nl:Bool -> @st:St -> @cc:Char -> St
a newline has been seen, so later whitespace may still be skipped
def lex.fold.go source · line 3667 · raw
@sp:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
more whitespace, or the next character of the string
def lex.fold source · line 3675 · raw
@st:St -> @+cc:Char -> St
whitespace after a line-ending backslash
def lex.bare.date.go source · line 3679 · raw
@date:Bool -> @st:St -> @cc:Char -> St
keep the space only when the buffer is a date; otherwise it ends the token
def lex.bare.date source · line 3687 · raw
@st:St -> @cc:Char -> St
a date may continue after one space
def lex.bare.hold source · line 3695 · raw
@skip:Bool -> @nl:Bool -> @inside:Bool -> Bool
a newline inside an inline table is held, and so is any other delimiter
def lex.bare.end source · line 3699 · raw
@st:St -> @+cc:Char -> St
a delimiter other than a date-space is held unless it is whitespace
def lex.bare.sp source · line 3706 · raw
@sp:Bool -> @st:St -> @cc:Char -> St
a space may be the space inside a datetime
def lex.bare.go source · line 3714 · raw
@delim:Bool -> @sp:Bool -> @st:St -> @cc:Char -> St
a delimiter ends the token
def lex.bare source · line 3722 · raw
@st:St -> @+cc:Char -> St
a bare value
def lex.date.digit source · line 3726 · raw
@st:St -> @cc:Char -> St
the space and the digit belong to the datetime
def lex.date.go source · line 3733 · raw
@digit:Bool -> @st:St -> @cc:Char -> St
the character after the space of a possible datetime
def lex.date source · line 3741 · raw
@st:St -> @+cc:Char -> St
the character after the space of a possible datetime
def lex.com.nl source · line 3745 · raw
@st:St -> @cc:Char -> St
the newline is read again in the state that was waiting
def lex.com.tab source · line 3752 · raw
@tab:Bool -> @st:St -> St
tab is the one control a comment may hold
def lex.com.ctl source · line 3760 · raw
@ctl:Bool -> @tab:Bool -> @st:St -> St
any other character is part of the comment
def lex.com.go source · line 3768 · raw
@nl:Bool -> @ctl:Bool -> @tab:Bool -> @st:St -> @cc:Char -> St
a comment runs to the end of the line and holds no control but tab
def lex.com source · line 3776 · raw
@st:St -> @+cc:Char -> St
a comment runs to the end of the line
def lex.head.arr source · line 3780 · raw
@st:St -> St
the header is an array of tables
def lex.head.br2 source · line 3787 · raw
@once:Bool -> @st:St -> St
one extra bracket
def lex.head.br.go source · line 3795 · raw
@fresh:Bool -> @once:Bool -> @st:St -> St
the second bracket is only legal at the start
def lex.head.br source · line 3803 · raw
@st:St -> St
[[ opens an array of tables when the key has not started
def lex.head.ch.go source · line 3812 · raw
@gap:Bool -> @st:St -> @cc:Char -> St
between segments a dot is required
def lex.head.ch source · line 3820 · raw
@st:St -> @cc:Char -> St
a bare character continues the segment, or starts one at the beginning
def lex.head.gap.go source · line 3830 · raw
@empty:Bool -> @st:St -> St
whitespace with no segment open still needs a segment after it, so a second
bracket there is refused: [[ is two brackets with nothing between
def lex.head.gap source · line 3838 · raw
@st:St -> St
whitespace ends a segment when one is open
def lex.head.dot3 source · line 3846 · raw
@empty:Bool -> @st:St -> St
a dot with no segment is rejected
def lex.head.dot2 source · line 3854 · raw
@st:St -> St
a dot ends the open segment
def lex.head.close2 source · line 3862 · raw
@arr:Bool -> @st:St -> St
an array of tables still needs one ]
def lex.head.close.go source · line 3870 · raw
@empty:Bool -> @arr:Bool -> @st:St -> St
push the last segment when the buffer holds one
def lex.head.close source · line 3878 · raw
@st:St -> St
] closes, or waits for the second ] of an array of tables
def lex.head.hash source · line 3886 · raw
@hash:Bool -> @st:St -> St
a comment in a header
def lex.head.quote.go source · line 3895 · raw
@fresh:Bool -> @st:St -> @kind:QKind -> St
a quote opens a segment only where none has started. After a bare character it would glue two keys into one segment, which toml.abnf does not allow
def lex.head.quote source · line 3903 · raw
@st:St -> @kind:QKind -> St
a quoted header segment, right after the bracket
def lex.head.lit source · line 3912 · raw
@lit:Bool -> @hash:Bool -> @st:St -> St
a literal header segment or a comment
def lex.head.q source · line 3920 · raw
@qq:Bool -> @lit:Bool -> @hash:Bool -> @st:St -> @_c:Char -> St
a quoted header segment or a comment
def lex.head.end source · line 3928 · raw
@end:Bool -> @qq:Bool -> @lit:Bool -> @hash:Bool -> @st:St -> @cc:Char -> St
the closing bracket, a quoted key, or a comment
def lex.head.dot source · line 3936 · raw
@dot:Bool -> @end:Bool -> @qq:Bool -> @lit:Bool -> @hash:Bool -> @st:St -> @cc:Char -> St
a dot, the end, or a quoted segment
def lex.head.sp source · line 3944 · raw
@sp:Bool -> @dot:Bool -> @end:Bool -> @qq:Bool -> @lit:Bool -> @hash:Bool -> @st:St -> @cc:Char -> St
whitespace, a dot, or the closing bracket
def lex.head.bare source · line 3956 · raw
@bare:Bool -> @sp:Bool -> @dot:Bool -> @end:Bool -> @headch:HeadCh -> @st:St -> @cc:Char -> St
a bare character, whitespace, a dot, or the end
def lex.head.go source · line 3973 · raw
@br:Bool -> @bare:Bool -> @sp:Bool -> @dot:Bool -> @end:Bool -> @headch:HeadCh -> @st:St -> @cc:Char -> St
a second bracket, a key character, or whitespace
def lex.head source · line 3990 · raw
@st:St -> @+cc:Char -> St
inside a header
def lex.hgap.end source · line 3996 · raw
@end:Bool -> @hash:Bool -> @st:St -> St
the end, or a comment
def lex.hgap.dot source · line 4004 · raw
@dot:Bool -> @end:Bool -> @hash:Bool -> @st:St -> St
a dot starts the next segment
def lex.hgap source · line 4012 · raw
@sp:Bool -> @dot:Bool -> @end:Bool -> @hash:Bool -> @st:St -> @_c:Char -> St
whitespace, a dot, or the end
def lex.head.gap.step source · line 4020 · raw
@st:St -> @+cc:Char -> St
between header segments
def lex.hdot.lit source · line 4024 · raw
@lit:Bool -> @st:St -> @_c:Char -> St
a literal segment, or a rejected character
def lex.hdot.q source · line 4032 · raw
@qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St
a quoted segment
def lex.hdot.bare source · line 4040 · raw
@bare:Bool -> @qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St
a bare segment or a quoted one
def lex.hdot source · line 4048 · raw
@sp:Bool -> @bare:Bool -> @qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St
whitespace or the next segment
def lex.head.dot.step source · line 4056 · raw
@st:St -> @+cc:Char -> St
after a dot, a segment must start
def lex.kq.char.go source · line 4060 · raw
@bad:Bool -> @st:St -> @cc:Char -> @stay:Lex -> St
a forbidden control, or one character of the key
def lex.kq.char source · line 4068 · raw
@st:St -> @+cc:Char -> @stay:Lex -> St
one character of a quoted key
def lex.kq.nl source · line 4072 · raw
@nl:Bool -> @st:St -> @+cc:Char -> @stay:Lex -> St
a newline in a key is rejected
def lex.esc.lex source · line 4080 · raw
@stay:Lex -> Lex
the escape state for a quoted key
def lex.kesc source · line 4088 · raw
@st:St -> @+stay:Lex -> St
the escape returns to the quoted key
def lex.kq.esc source · line 4095 · raw
@basic:Bool -> @st:St -> @stay:Lex -> St
only a basic key treats the backslash as an escape
def lex.kq.bs source · line 4103 · raw
@bs:Bool -> @basic:Bool -> @nl:Bool -> @st:St -> @cc:Char -> @stay:Lex -> St
an escape in a basic key
def lex.qkey.end source · line 4111 · raw
@st:St -> @next:Lex -> St
a quoted segment may be empty
def lex.kq.go source · line 4115 · raw
@quote:Bool -> @bs:Bool -> @basic:Bool -> @nl:Bool -> @st:St -> @cc:Char -> @back:Lex -> @stay:Lex -> St
the closer, an escape, or a character
def lex.kq source · line 4123 · raw
@st:St -> @+cc:Char -> @back:Lex -> @stay:Lex -> St
a quoted key segment. back is the state after the closer; stay is this quote
def lex.head.r.go source · line 4131 · raw
@end:Bool -> @st:St -> St
the second ] of an array of tables
def lex.head.r source · line 4139 · raw
@st:St -> @+cc:Char -> St
the second ] of an array of tables
def lex.arr.end source · line 4143 · raw
@end:Bool -> @st:St -> @cc:Char -> St
] closes; anything else is a value
def lex.arr.hash source · line 4151 · raw
@hash:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
a comment, the end, or a value
def lex.arr.nl source · line 4159 · raw
@nl:Bool -> @hash:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
a newline is whitespace in an array
def lex.arr.go source · line 4167 · raw
@sp:Bool -> @nl:Bool -> @hash:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
whitespace, a comment, the end, or a value
def lex.arr source · line 4175 · raw
@st:St -> @+cc:Char -> St
an array waits for a value or ]
def lex.arrc.end source · line 4179 · raw
@end:Bool -> @st:St -> St
] closes the array
def lex.arrc.comma source · line 4187 · raw
@comma:Bool -> @end:Bool -> @st:St -> St
a comma waits for another value
def lex.arrc.hash source · line 4195 · raw
@hash:Bool -> @comma:Bool -> @end:Bool -> @st:St -> @_c:Char -> St
a comment, a comma, or the end
def lex.arrc.nl source · line 4203 · raw
@nl:Bool -> @hash:Bool -> @comma:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
a newline is whitespace
def lex.arrc.go source · line 4211 · raw
@sp:Bool -> @nl:Bool -> @hash:Bool -> @comma:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
whitespace, a comment, a comma, or the end
def lex.arrc source · line 4219 · raw
@st:St -> @+cc:Char -> St
after an array value: a comma, ], or whitespace
def lex.key.clear source · line 4224 · raw
@st:St -> St
a new key starts with an empty segment list
def lex.key.bare source · line 4231 · raw
@ok:Bool -> @st:St -> @cc:Char -> St
a bare character opens the key
def lex.key.lit source · line 4239 · raw
@lit:Bool -> @st:St -> @+cc:Char -> St
a literal quote or a bare character opens the key
def lex.key.q source · line 4247 · raw
@qq:Bool -> @st:St -> @+cc:Char -> St
a quote or a bare character opens the key
def lex.key.start source · line 4255 · raw
@st:St -> @+cc:Char -> St
the first character of a key inside an inline table
def lex.inl.nl source · line 4259 · raw
@nl:Bool -> @st:St -> @cc:Char -> St
a newline is rejected; anything else is a key
def lex.inl.end source · line 4267 · raw
@end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
} closes an empty inline table
def lex.inl.hash source · line 4275 · raw
@hash:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment, the end, or a key
def lex.inl.go source · line 4283 · raw
@sp:Bool -> @hash:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace, a comment, the end, or a key
def lex.inl source · line 4291 · raw
@st:St -> @+cc:Char -> St
an inline table waits for a key or }
def lex.inlk.hash source · line 4295 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment or a key
def lex.inlk.go source · line 4303 · raw
@sp:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace or a key
def lex.inlk source · line 4311 · raw
@st:St -> @+cc:Char -> St
after a comma, a key is required
def lex.inlc.nl source · line 4315 · raw
@nl:Bool -> @st:St -> St
a newline is rejected
def lex.inlc.end source · line 4323 · raw
@end:Bool -> @nl:Bool -> @st:St -> @_c:Char -> St
} closes the inline table
def lex.inlc.comma source · line 4331 · raw
@comma:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comma requires another key
def lex.inlc.hash source · line 4339 · raw
@hash:Bool -> @comma:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment, a comma, or the end
def lex.inlc.go source · line 4347 · raw
@sp:Bool -> @hash:Bool -> @comma:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace, a comment, a comma, or the end
def lex.inlc source · line 4355 · raw
@st:St -> @+cc:Char -> St
after an inline value: a comma or }
def lex.sink source · line 4360 · raw
@st:St -> @_c:Char -> St
the rest of a failed document is ignored
def lex.line.nl source · line 4364 · raw
@nl:Bool -> @st:St -> St
anything else on the same line is another expression
def lex.line.hash source · line 4372 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @_c:Char -> St
a comment may follow an expression
def lex.line.go source · line 4380 · raw
@sp:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace, a comment, or a newline after an expression
def lex.line source · line 4388 · raw
@st:St -> @+cc:Char -> St
after an expression, the rest of the line is whitespace or a comment
def lex.kdot.nl source · line 4392 · raw
@nl:Bool -> @st:St -> St
a newline in a dotted key is rejected
def lex.kdot.dot source · line 4400 · raw
@dot:Bool -> @nl:Bool -> @st:St -> St
a second dot is an empty segment
def lex.kdot.bare source · line 4408 · raw
@bare:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a bare character starts the segment
def lex.kdot.lit source · line 4416 · raw
@lit:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @+cc:Char -> St
a literal quote starts the segment
def lex.kdot.q source · line 4424 · raw
@qq:Bool -> @lit:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a quote starts the segment
def lex.kdot.go source · line 4432 · raw
@sp:Bool -> @qq:Bool -> @lit:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace or the next segment
def lex.kdot source · line 4440 · raw
@st:St -> @+cc:Char -> St
after a dot, whitespace and then a segment
def lex.hq source · line 4445 · raw
@st:St -> @+cc:Char -> St
a quoted header segment
def read.on source · line 4449 · raw
@lex:Lex -> @st:St -> @char:Char -> St
one character, dispatched on the lex state
def read.on.st source · line 4523 · raw
@st:St -> @cc:Char -> St
read the lex state and step
def read.step.bom source · line 4530 · raw
@bom:Bool -> @st:St -> @cc:Char -> St
one character, after a leading mark has been decided
def read.step.lead source · line 4538 · raw
@lead:Bool -> @st:St -> @+cc:Char -> St
the first character may be a byte-order mark
def read.step source · line 4546 · raw
@st:St -> @+cc:Char -> St
one character of the document
def read.once.hold source · line 4553 · raw
@hold:Hold -> @st:St -> St
a held character is read once
def read.once2 source · line 4561 · raw
@st:St -> St
a held character is read once
def read.once source · line 4568 · raw
@st:St -> @cc:Char -> St
one new character, then a held character if the step asked for one
def read.fin.lex source · line 4572 · raw
@lex:Lex -> @st:St -> St
a bare token, an empty string or a closed multiline string still open at the end
def read.fin.close source · line 4586 · raw
@st:St -> St
a bare token still open at the end is closed
def rows.seal.fin source · line 4593 · raw
@rev:Bool -> @acc:List<&2, Val> -> List<&2, Val>
builder order is newest-first. a kept list is reversed back; a builder list is not
def rows.seal.go source · line 4601 · raw
@vs:List<&2, Val> -> @rev:Bool -> @acc:List<&2, Val> -> List<&2, Val>
put every table back in insertion order. one pass, no append along the way
def rows.seal source · line 4626 · raw
@rows:List<&2, Val> -> List<&2, Val>
insertion order of a table built newest-first
def read.fin.stack source · line 4630 · raw
@stack:List<&2, Ctx> -> @bad:String -> @rows:List<&2, Val> -> Doc
an open frame at the end is an error
def read.fin.doc source · line 4638 · raw
@st:St -> Doc
the document from a finished state
def read.fin.unclosed source · line 4644 · raw
@st:St -> Doc
an unfinished document keeps the first error
def read.fin.end source · line 4650 · raw
@lex:Lex -> Bool
a comment may end a document only where the line already could
def read.fin.com source · line 4662 · raw
@ok:Bool -> @st:St -> Doc
a comment at the end is unfinished when it interrupted a key or a value
def read.fin.com.st source · line 4670 · raw
@st:St -> Doc
a comment at the end is unfinished when it interrupted a key or a value
def read.fin.bad source · line 4677 · raw
@st:St -> Doc
any other state is unfinished
def read.fin.ok source · line 4681 · raw
@lex:Lex -> @st:St -> Doc
the states that may end a document
def read.fin2 source · line 4695 · raw
@st:St -> Doc
the document once the last token has been closed
def read.fin source · line 4702 · raw
@st:St -> Doc
the document at the end of the text
def read.fast.st source · line 4712 · raw
@lex:Lex -> @qkind:QKind -> @fast:Fast -> St
one scanner state, with the hold cleared and the first character already taken
def read.fast.cons source · line 4718 · raw
@lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
the character joins the buffer and the state stays
def read.fast.old source · line 4724 · raw
@lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
a quote, an escape, or a state this step does not special-case
def read.fast.push source · line 4728 · raw
@ctrl:Bool -> @lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
a forbidden control takes the full step; a plain character is stored
def read.fast.basic.bs source · line 4736 · raw
@bs:Bool -> @fast:Fast -> @+cc:Char -> St
a basic-string character that is not a quote
def read.fast.basic source · line 4744 · raw
@quote:Bool -> @bs:Bool -> @fast:Fast -> @+cc:Char -> St
a basic-string character: a quote or a backslash still takes the full step
def read.fast.lit source · line 4752 · raw
@quote:Bool -> @fast:Fast -> @+cc:Char -> St
a literal-string character: a quote still takes the full step
def read.fast.str source · line 4760 · raw
@qkind:QKind -> @fast:Fast -> @+cc:Char -> St
one character of a string
def read.fast.key source · line 4770 · raw
@ok:Bool -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
one character of a bare key
def read.fast.bare source · line 4778 · raw
@delim:Bool -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
one character of a bare value
def read.fast.com source · line 4786 · raw
@ctl:Bool -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
one character of a comment. a control, a newline among them, takes the full step
def read.fast.ws.keep source · line 4794 · raw
@keep:Bool -> @lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
whitespace that this state ignores. keep is true when a newline is also ignored
def read.fast.ws.nl source · line 4802 · raw
@nl:Bool -> @keep:Bool -> @lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
a newline this state ignores, or the full step
def read.fast.ws source · line 4817 · raw
@sp:Bool -> @nl:Bool -> @keep:Bool -> @lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
space stays in this state; a newline stays only when keep is set
def read.fast.lex source · line 4833 · raw
@lex:Lex -> @qkind:QKind -> @fast:Fast -> @+char:Char -> St
the states whose plain characters do not change the scanner
def read.fast.lead source · line 4865 · raw
@lead:Bool -> @lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
the first character may be a byte-order mark; later characters take the fast step
def read.fast.hold source · line 4875 · raw
@hold:Hold -> @lead:Bool -> @lex:Lex -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> St
a held character is still read by the full step, then this character
def read.fast source · line 4892 · raw
@st:St -> @+cc:Char -> St
one source character
def eat.fin source · line 4918 · raw
@_n:U32 -> @_u:Unit -> @carry:Carry -> Doc
an unclosed string
def eat.close source · line 4924 · raw
@cut:String -> @nn:U32 -> @carry:Carry -> St
a plain string is the first n characters of the source suffix
def eat.copy source · line 4930 · raw
@+cc:Char -> @cut:String -> @+nn:U32 -> @carry:Carry -> Mode
an escape or a forbidden control copies the span so far and continues
def eat.ctrl source · line 4936 · raw
@badc:Bool -> @basic:Bool -> @qq:Char -> @cc:Char -> @cut:String -> @nn:U32 -> @carry:Carry -> Mode
a forbidden control leaves the span; a plain character extends it
def eat.bs source · line 4954 · raw
@bs:Bool -> @basic:Bool -> @qq:Char -> @+cc:Char -> @cut:String -> @nn:U32 -> @carry:Carry -> Mode
a backslash in a basic string leaves the span
def eat.basic source · line 4970 · raw
@basic:Bool -> @qq:Char -> @+cc:Char -> @cut:String -> @nn:U32 -> @carry:Carry -> Mode
a literal string keeps a backslash; a basic string does not
def eat.feed.q source · line 4985 · raw
@quote:Bool -> @basic:Bool -> @qq:Char -> @cc:Char -> @cut:String -> @nn:U32 -> @carry:Carry -> Mode
a quote closes the span
def eat.feed source · line 5001 · raw
@basic:Bool -> @+qq:Char -> @cut:String -> @nn:U32 -> @carry:Carry -> @+cc:Char -> Mode
one character of a plain string. cut is the suffix where the text began
def doc.open.eat source · line 5012 · raw
@_back:Lex -> @mode:Mode -> Mode
the opening quote's back state is not kept on the span
def doc.drop source · line 5016 · raw
@_tail:String -> @mode:Mode -> Mode
a suffix the span does not keep
def doc.open.buf source · line 5020 · raw
@basic:Bool -> @qq:Char -> @qkind:QKind -> @fast:Fast -> @cc:Char -> @tail:String -> Mode
an empty buffer starts a span; a buffer already in use stays on the old path
def doc.open.ok source · line 5038 · raw
@badc:Bool -> @basic:Bool -> @qq:Char -> @qkind:QKind -> @fast:Fast -> @cc:Char -> @tail:String -> Mode
a forbidden control leaves the span
def doc.open.bs source · line 5054 · raw
@bs:Bool -> @qq:Char -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> @tail:String -> Mode
a backslash in a basic string leaves the span
def doc.open.b source · line 5069 · raw
@basic:Bool -> @qq:Char -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> @tail:String -> Mode
a literal string keeps a backslash; a basic string does not
def doc.open.q source · line 5084 · raw
@same:Bool -> @basic:Bool -> @qq:Char -> @qkind:QKind -> @fast:Fast -> @cc:Char -> @tail:String -> Mode
a second quote is an empty string or the start of a multiline string
def doc.open source · line 5100 · raw
@basic:Bool -> @+qq:Char -> @qkind:QKind -> @fast:Fast -> @+cc:Char -> @tail:String -> Mode
the character after an opening quote
def doc.scan.kind source · line 5111 · raw
@qkind:QKind -> @fast:Fast -> Mode
a one-line string may be a span; a multiline string stays on the old path
def doc.scan.lead source · line 5127 · raw
@lead:Bool -> @qkind:QKind -> @fast:Fast -> Mode
the first character of the file is still the old step
def doc.scan.hold source · line 5137 · raw
@hold:Hold -> @lead:Bool -> @qkind:QKind -> @fast:Fast -> Mode
a held character is not the start of a span
def doc.wrap.lex source · line 5147 · raw
@lex:Lex -> @qkind:QKind -> @hold:Hold -> @fast:Fast -> @lead:Bool -> Mode
a quote opened a one-line string, or the state is rebuilt around that quote
def doc.wrap source · line 5157 · raw
@st:St -> Mode
a quote may have opened a string
def doc.scan.cr source · line 5164 · raw
@cr:Bool -> @st:St -> @cc:Char -> Mode
a carriage return must be followed by a line feed
def doc.scan.sq source · line 5172 · raw
@sq:Bool -> @cr:Bool -> @st:St -> @cc:Char -> Mode
an apostrophe may open a literal string
def doc.scan.q source · line 5180 · raw
@dq:Bool -> @sq:Bool -> @cr:Bool -> @st:St -> @cc:Char -> Mode
a quote may open a basic string. any other character is the old step
def doc.scan source · line 5188 · raw
@st:St -> @+cc:Char -> Mode
one source character outside a plain string
def doc.cr source · line 5193 · raw
@lf:Bool -> @st:St -> @cc:Char -> Mode
the character after a carriage return: a line feed ends the line, anything else fails
def doc.read source · line 5201 · raw
@text:String -> @mode:Mode -> Doc
one character at a time. a plain string keeps a span of this suffix
def st.start source · line 5229 · raw
St
a scanner at the start of a document
def span.esc source · line 5244 · raw
@+uu:U32 -> Bool
quote, backslash, or a control. those still take the escaping writer
def span.quote.push source · line 5249 · raw
@esc:Bool -> @acc:SqAcc -> @+hh:Char -> SqAcc
cons one plain character. an escape, or a stop already seen, stays stopped
def span.quote.end source · line 5259 · raw
@acc:SqAcc -> Sq
the reversed body, or a stop, as the quoting result
def span.quote.go source · line 5267 · raw
@src:String -> @+nn:U32 -> @zz:Bool -> @acc:SqAcc -> Sq
the first n characters, reversed onto acc. a character that needs an escape stops
def span.quote.fin source · line 5278 · raw
@hit:Sq -> @src:String -> @+nn:U32 -> String
quotes around a plain span, or the escaping writer when a character needs it
def span.quote source · line 5286 · raw
@+src:String -> @+nn:U32 -> String
a plain string span, quoted without rebuilding an escaped copy
def render.bool source · line 5290 · raw
@bit:Bool -> String
true or false
def render.atom source · line 5298 · raw
@vv:Val -> String
a scalar value
def render.suf.last source · line 5316 · raw
@last:Bool -> @gap:String -> String
a separator that is omitted after the last item
def render.suf source · line 5324 · raw
@+gap:String -> @trail:Bool -> @last:Bool -> String
a separator. trail keeps the separator after the last item
def render.go source · line 5332 · raw
@vs:List<&2, Val> -> @+gap:String -> @+trail:Bool -> String
the values of a table, an array, or an inline table
def render.skip source · line 5365 · raw
@_path:String -> @_rows:List<&2, Val> -> @_tail:List<&2, Val> -> @_gap:String -> @_trail:Bool -> @nest:(@_:Unit -> String) -> @rest:(@_:Unit -> String) -> String
a nested table rendering that this pass does not print
def render.use source · line 5378 · raw
@_rows:List<&2, Val> -> @text:String -> String
the rows are already closed over by the nested rendering
def render.rest source · line 5382 · raw
@_tail:List<&2, Val> -> @_gap:String -> @_trail:Bool -> @rest:(@_:Unit -> String) -> String
a header already ends in a newline
def render.head source · line 5386 · raw
@tabs:Bool -> @path:String -> @rows:List<&2, Val> -> @tail:List<&2, Val> -> @gap:String -> @trail:Bool -> @nest:(@_:Unit -> String) -> @rest:(@_:Unit -> String) -> String
a table header. Direct keys are printed by the other pass
def render.aots source · line 5404 · raw
@tabs:Bool -> @elems:List<&2, Val> -> @tail:List<&2, Val> -> @gap:String -> @trail:Bool -> @nest:(@_:Unit -> String) -> @rest:(@_:Unit -> String) -> String
an array of tables. Its elements are headers
def render.aot source · line 5420 · raw
@tabs:Bool -> @path:String -> @rows:List<&2, Val> -> @tail:List<&2, Val> -> @gap:String -> @trail:Bool -> @nest:(@_:Unit -> String) -> @rest:(@_:Unit -> String) -> String
one element of an array of tables
def render.late source · line 5438 · raw
@tabs:Bool -> @text:(@_:Unit -> String) -> @tail:List<&2, Val> -> @gap:String -> @trail:Bool -> @rest:(@_:Unit -> String) -> String
a key, an array, or an inline table. The text is built only by the pass that writes keys
def render.pass source · line 5453 · raw
@vs:List<&2, Val> -> @+gap:String -> @+trail:Bool -> @+tabs:Bool -> String
one pass: keys, or the tables that follow them
def render.both source · line 5492 · raw
@+vs:List<&2, Val> -> @+gap:String -> @+trail:Bool -> String
keys first, then tables and arrays of tables
def string source · line 5496 · raw
@vv:Val -> String
the text of a string value
def digits source · line 5506 · raw
@vv:Val -> String
the digits of an integer value
def flag source · line 5514 · raw
@vv:Val -> Bool
the bit of a boolean value
def at.rows source · line 5522 · raw
@vv:Val -> List<&2, Val>
the rows of a table value
def at.rows_of source · line 5534 · raw
@hh:Hit -> List<&2, Val>
the rows of a hit, when it is a table
def at.step source · line 5542 · raw
@rest:List<&2, String> -> @hit:Hit -> Hit
the rest of a path after the first key
def at source · line 5550 · raw
@rows:List<&2, Val> -> @path:List<&2, String> -> Hit
the value at a dotted path
def root source · line 5558 · raw
@doc:Doc -> List<&2, Val>
the root table
def bad source · line 5563 · raw
@doc:Doc -> String
the first error, or "" when the document is well formed
def str source · line 5568 · raw
@text:String -> Val
a string value
def integer source · line 5572 · raw
@sign:Sign -> @text:String -> Val
an integer value
def float source · line 5576 · raw
@sign:Sign -> @text:String -> Val
a float value
def boolean source · line 5580 · raw
@bit:Bool -> Val
a boolean value
def array source · line 5584 · raw
@items:List<&2, Val> -> Val
an array value
def inline source · line 5588 · raw
@rows:List<&2, Val> -> Val
an inline table
def table source · line 5592 · raw
@path:String -> @rows:List<&2, Val> -> Val
a table
def pair source · line 5596 · raw
@name:String -> @val:Val -> Val
a key and a value
def render source · line 5600 · raw
@doc:Doc -> String
a document written back as TOML
def parse source · line 5607 · raw
@text:String -> Doc
a document read from TOML text. The text is code points: Bend's File.read decodes UTF-8 and replaces an invalid byte with U+FFFD rather than refusing it, so a caller that must refuse invalid bytes checks the file first
def wf.then source · line 5636 · raw
@ok:Bool -> @more:(@_:Unit -> Bool) -> Bool
the rest when this part holds, and False otherwise
def wf.char source · line 5644 · raw
@+cc:Char -> Bool
a Unicode scalar value: no surrogate, and nothing past U+10FFFF
def wf.text source · line 5648 · raw
@ss:String -> Bool
every character of a string or a key is a Unicode scalar value
def wf.span source · line 5656 · raw
@src:String -> @+nn:U32 -> @zz:Bool -> Bool
a span's source holds its n characters, each a Unicode scalar value
def wf.digits source · line 5666 · raw
@ss:String -> Bool
every character is an ASCII digit
def wf.dec.lead source · line 5674 · raw
@zero:Bool -> @+cc:Char -> @rest:String -> Bool
a lone 0, or a first digit that is not 0 and more digits
def wf.dec source · line 5682 · raw
@ss:String -> Bool
decimal digits with no leading zero, except 0 itself
def wf.int source · line 5690 · raw
@+sign:Sign -> @+digits:String -> Bool
an integer: decimal digits within signed 64 bits
def wf.flo.is_e source · line 5694 · raw
@+cc:Char -> Bool
e or E
def wf.flo.tail source · line 5698 · raw
@+cc:Char -> Fl
after the integer part: a fraction or an exponent
def wf.flo.step source · line 5702 · raw
@st:Fl -> @+cc:Char -> Fl
one character of a float's spelling
def wf.flo.go source · line 5725 · raw
@cs:List<&2, Char> -> @st:Fl -> Fl
a float's spelling read from the given state
def wf.flo.end source · line 5733 · raw
@st:Fl -> Bool
a spelling ends after a fraction's digit or an exponent's digit
def wf.flo source · line 5743 · raw
@+text:String -> Bool
a float's spelling: inf, nan, or toml.abnf's float with no sign and no _
def wf.date source · line 5748 · raw
@dd:Date -> Bool
a date: a four-digit year, a month, and a day within that month in that year
def wf.clock source · line 5753 · raw
@cc:Clock -> Bool
a time of day: hour, minute and second in range, and a fraction of digits
def wf.zone source · line 5758 · raw
@zz:Zone -> Bool
a zone offset in range
def wf.when source · line 5766 · raw
@ww:When -> Bool
a datetime whose fields are in range
def wf.atom source · line 5779 · raw
@vv:Val -> Bool
a string, a number, a boolean or a datetime, well-formed. Nothing else is a scalar
def wf.fresh source · line 5797 · raw
@hit:Hit -> Bool
a name no later pair of the table has
def wf.key source · line 5805 · raw
@+name:String -> @+rest:List<&2, Val> -> Bool
a pair's key: Unicode scalar values, and no later pair of the same name
def wf.head source · line 5809 · raw
@at:WfAt -> @+name:String -> @+path:String -> @+rest:List<&2, Val> -> @more:(@_:Unit -> Bool) -> Bool
a table as a pair's value, in a table's rows, at the path its name gives
def wf.aots source · line 5818 · raw
@at:WfAt -> @+name:String -> @+path:String -> @some:Bool -> @+rest:List<&2, Val> -> @more:(@_:Unit -> Bool) -> Bool
an array of tables as a pair's value, in a table's rows, at the path its name gives, with at least one element
def wf.aot source · line 5833 · raw
@at:WfAt -> @+path:String -> @more:(@_:Unit -> Bool) -> Bool
an element of an array of tables, at the array's path
def wf.pair source · line 5841 · raw
@at:WfAt -> @+name:String -> @+rest:List<&2, Val> -> @ok:Bool -> @more:(@_:Unit -> Bool) -> Bool
a pair of any other value, in a table's or an inline table's rows
def wf.item source · line 5851 · raw
@at:WfAt -> @ok:Bool -> @more:(@_:Unit -> Bool) -> Bool
a value that is not a pair, as an array's item
def wf.go source · line 5859 · raw
@vs:List<&2, Val> -> @+at:WfAt -> Bool
a list of values, well-formed where it sits
def wf source · line 5894 · raw
@doc:Doc -> Bool
whether a document is well-formed: the shapes parse returns. Tables and arrays of tables sit only as a pair's value in a table's rows, each at the path its parent's path and its name give; a table's keys are distinct; numbers, datetimes and strings are as parse reads them. The error is not looked at