main.bend checks
raw source on the hub · import emerging-eztoml@0.7.0.0/main.bend as Main
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 11 · raw
Data
the sign of an integer, a float, or a zone offset
PlusSign
MinusSign
type Date source · line 16 · raw
Data
a calendar date: year, month, day
Date@y:U32 -> @mo:U32 -> @d:U32 -> Date
type Clock source · line 20 · 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 24 · raw
Data
a zone offset: Z, or a numeric offset
ZuluZone
Shift@sign:Sign -> @h:U32 -> @mi:U32 -> Zone
type When source · line 29 · 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 39 · 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 54 · raw
Data
a key found in a table, or not
Found@val:Val -> Hit
MissHit
type Doc source · line 59 · 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 63 · 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 68 · raw
Data
digits taken from the front of a character list
DigOk@n:U32 -> @cs:List<&2, Char> -> Dig
DigBadDig
type WhenOut source · line 73 · raw
Data
what a datetime scan produced
WSome@when:When -> WhenOut
WFail@why:String -> WhenOut
WSkipWhenOut
type NK source · line 79 · raw
Data
a decimal numeral being built, least-significant digit first
NLeadNK
NSignNK
NZeroNK
NDigNK
NBaseNK
NFracNK
NExpNK
NEDigNK
NBadNK
type Num source · line 91 · 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 96 · raw
Data
how a basic-string character is written
BKChBK
BKHexBK
BKEsc@mark:Char -> BK
type Lex source · line 102 · 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 140 · raw
Data
which quotes a string is using
QBasicQKind
QLitQKind
QMultiQKind
QMultiLitQKind
type Hold source · line 147 · raw
Data
one character to read again
HNoneHold
HChar@c:Char -> Hold
type Ctx source · line 152 · 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 157 · 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 164 · 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 1859 · raw
Data
a change applied at the end of a key path
JPut@val:Val -> Job
JDefJob
JAotJob
type Fr source · line 1865 · 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 1871 · 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 1876 · raw
Data
the root table after a walk
End@vs:List<&2, Val> -> @bad:String -> @heads:List<&2, String> -> End
type Look source · line 1880 · 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 1888 · 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 Mode source · line 5168 · 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 Sq source · line 5708 · 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 5713 · 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 6088 · 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 6096 · 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 171 · raw
@+cc:Char -> Bool
a character a bare key may hold
def bare.all.step source · line 176 · 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 184 · raw
@cs:List<&2, Char> -> Bool
whether every character of a key is one a bare key may hold
def bare source · line 192 · raw
@+ss:String -> Bool
whether a key can be written without quotes
def hex.char.go source · line 196 · raw
@dec:Bool -> @nn:U32 -> Char
one hex nibble as a character
def hex.char source · line 204 · raw
@+nn:U32 -> Char
one hex nibble as a character
def basic.hex source · line 208 · 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 214 · 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 218 · raw
@hit:Bool -> BK
other controls are \u escapes; the rest are themselves
def basic.cls.bslash source · line 226 · raw
@hit:Bool -> @+uu:U32 -> BK
backslash
def basic.cls.quote source · line 234 · raw
@hit:Bool -> @+uu:U32 -> BK
quotation mark
def basic.cls.cr source · line 242 · raw
@hit:Bool -> @+uu:U32 -> BK
carriage return
def basic.cls.ff source · line 250 · raw
@hit:Bool -> @+uu:U32 -> BK
form feed
def basic.cls.lf source · line 258 · raw
@hit:Bool -> @+uu:U32 -> BK
line feed
def basic.cls.tab source · line 266 · raw
@hit:Bool -> @+uu:U32 -> BK
tab
def basic.cls.bs source · line 274 · raw
@hit:Bool -> @+uu:U32 -> BK
backspace, then the rest
def basic.cls source · line 282 · raw
@+uu:U32 -> BK
the class of a code point in a basic string
def basic.disp source · line 286 · 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 296 · raw
@+cc:Char -> @out:List<&2, Char> -> List<&2, Char>
one character of a basic string
def basic.go source · line 301 · raw
@cs:List<&2, Char> -> @out:List<&2, Char> -> List<&2, Char>
the escaped characters of a basic string, reversed
def key.basic source · line 309 · raw
@+ss:String -> String
a basic string: quotes, with controls and quotes escaped
def key.go source · line 314 · raw
@ok:Bool -> @+ss:String -> String
bare when the name allows it, otherwise a basic string
def key source · line 322 · raw
@+ss:String -> String
a key as TOML writes it
def dec.carry.c0 source · line 326 · raw
@zz:Bool -> @cc:U32 -> List<&2, U32>
the overflow of a decimal step, least-significant digit first
def dec.carry.c source · line 334 · raw
@+cc:U32 -> List<&2, U32>
the overflow of a decimal step
def dec.carry.b0 source · line 338 · raw
@zz:Bool -> @+cc:U32 -> List<&2, U32>
the next digit of an overflow
def dec.carry.b source · line 346 · raw
@+cc:U32 -> List<&2, U32>
the next digit of an overflow
def dec.carry.a source · line 350 · raw
@zz:Bool -> @+cc:U32 -> List<&2, U32>
the first digit of an overflow
def dec.carry source · line 358 · raw
@+cc:U32 -> List<&2, U32>
the digits of a leftover carry
def dec.go source · line 362 · 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 371 · raw
@dd:U32 -> Char
a digit character
def dec.chars source · line 375 · raw
@ds:List<&2, U32> -> List<&2, Char>
digits as characters, in the order given
def dec.drop.lead source · line 383 · raw
@lead:Bool -> @+hh:Char -> Bool
whether a leading zero is still being skipped
def dec.drop.outz source · line 391 · 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 399 · raw
@lead:Bool -> @+hh:Char -> @out:List<&2, Char> -> List<&2, Char>
the output after one character, reversed
def dec.drop.end source · line 407 · raw
@lead:Bool -> @out:List<&2, Char> -> String
the numeral, or 0 when every digit was zero
def dec.drop source · line 415 · 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 423 · raw
@ds:List<&2, U32> -> String
a decimal numeral. The digit list is least-significant first
def dig.up source · line 427 · 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 435 · raw
@ok:Bool -> @+uu:U32 -> U32
a lowercase hex digit, otherwise an uppercase one
def dig.dec source · line 443 · raw
@ok:Bool -> @+uu:U32 -> U32
a decimal digit, otherwise a hex letter
def dig.val source · line 451 · raw
@+cc:Char -> U32
the value of a digit character, or 99
def dig.ok source · line 456 · raw
@dd:U32 -> @base:U32 -> Bool
whether a digit value fits a base
def take.acc.d source · line 460 · raw
@digit:Bool -> @nn:U32 -> @+cc:Char -> U32
exactly k digits, or DigBad
def take.acc source · line 468 · raw
@ok:Bool -> @nn:U32 -> @+cc:Char -> U32
the accumulator after one character
def take.ok source · line 476 · raw
@ok:Bool -> @+cc:Char -> Bool
the scan stays well only while every character is a digit
def take.fin source · line 484 · raw
@ok:Bool -> @nn:U32 -> @cs:List<&2, Char> -> Dig
the finished take
def take.n source · line 492 · 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 504 · raw
@+nn:U32 -> @lo:U32 -> @hi:U32 -> Bool
a number is inside the inclusive bounds
def pad2.go source · line 508 · raw
@small:Bool -> @nn:U32 -> String
two digits, zero padded
def text.pad2 source · line 516 · raw
@+nn:U32 -> String
two digits, zero padded
def pad4.big source · line 520 · raw
@nn:U32 -> @big:Bool -> String
the one-zero pad, or the digits themselves
def pad4.mid source · line 528 · raw
@nn:U32 -> @mid:Bool -> @big:Bool -> String
the three-digit and two-digit pads
def pad4.go source · line 536 · raw
@nn:U32 -> @small:Bool -> @mid:Bool -> @big:Bool -> String
four digits, zero padded
def text.pad4 source · line 544 · raw
@+nn:U32 -> String
four digits, zero padded
def zone.mark source · line 548 · raw
@sign:Sign -> String
the sign of a zone offset
def zone.shift source · line 556 · raw
@sign:Sign -> @hh:U32 -> @mi:U32 -> String
a numeric zone offset
def zone.text source · line 560 · raw
@zz:Zone -> String
a zone suffix
def clock.frac.go source · line 568 · raw
@empty:Bool -> @frac:String -> String
the fractional second, or nothing
def clock.frac source · line 576 · raw
@+frac:String -> String
the fractional second, or nothing
def clock.text source · line 580 · raw
@cc:Clock -> String
a clock, with a fractional second when it has one
def date.text source · line 585 · raw
@dd:Date -> String
a date
def when.text source · line 590 · raw
@ww:When -> String
a datetime in TOML spelling
def sign.text source · line 602 · raw
@sign:Sign -> String
the sign of an integer or a float, empty when it is positive
def cs.some source · line 610 · raw
@cs:List<&2, Char> -> Bool
whether the list still has a character
def cs.head source · line 618 · raw
@cs:List<&2, Char> -> Char
one character, when the list has one
def cs.tail source · line 626 · raw
@cs:List<&2, Char> -> List<&2, Char>
the tail of a list
def clock.with source · line 634 · raw
@cc:Clock -> @frac:String -> Clock
a clock with its fraction filled in
def when.done source · line 639 · 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 643 · raw
@tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
Z ends the token
def when.zone.mm.ok2 source · line 651 · 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 659 · 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 667 · 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 684 · raw
@dd:Dig -> @sign:Sign -> @+hh:U32 -> @clock:Clock -> @date:Date -> WhenOut
the offset minute is in range
def when.zone.mm source · line 692 · raw
@hit:Bool -> @dd:Dig -> @sign:Sign -> @hh:U32 -> @clock:Clock -> @date:Date -> WhenOut
the offset minute
def when.zone.hh.colon source · line 700 · 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 708 · raw
@dd:Dig -> @sign:Sign -> @clock:Clock -> @date:Date -> WhenOut
the offset hour
def when.zone.off source · line 716 · raw
@sign:Sign -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
HH:MM of a numeric offset
def when.zone.minus source · line 720 · raw
@minus:Bool -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut
a minus starts a numeric offset
def when.zone.sign source · line 728 · 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 736 · 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 744 · 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 753 · 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 762 · 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 766 · 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 782 · raw
@cs:List<&2, Char> -> @+rev:List<&2, Char> -> @+clock:Clock -> @+date:Date -> WhenOut
fractional digits
def when.frac.go source · line 791 · 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 799 · raw
@cs:List<&2, Char> -> @+clock:Clock -> @+date:Date -> WhenOut
an optional fractional second
def when.clock.range.s source · line 807 · 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 815 · 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 823 · 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 840 · raw
@dd:Dig -> @+hh:U32 -> @+mi:U32 -> @date:Date -> WhenOut
seconds, then an optional fraction and zone
def when.clock.ss source · line 849 · raw
@hit:Bool -> @dd:Dig -> @hh:U32 -> @mi:U32 -> @date:Date -> WhenOut
seconds after the colon
def when.clock.mm.colon source · line 857 · raw
@cs:List<&2, Char> -> @hh:U32 -> @mi:U32 -> @date:Date -> WhenOut
the colon after the minutes
def when.clock.mm source · line 865 · raw
@dd:Dig -> @hh:U32 -> @date:Date -> WhenOut
minutes, then seconds
def when.clock.colon.go source · line 873 · raw
@hit:Bool -> @hh:U32 -> @tt:List<&2, Char> -> @date:Date -> WhenOut
the colon after the hour
def when.clock.colon source · line 881 · raw
@cs:List<&2, Char> -> @hh:U32 -> @date:Date -> WhenOut
the colon after the hour
def when.clock.of source · line 889 · raw
@dd:Dig -> @date:Date -> WhenOut
a clock following a date
def when.after.sp source · line 897 · raw
@sp:Bool -> @date:Date -> @tt:List<&2, Char> -> WhenOut
a space separates a date from a time
def when.after.sep source · line 905 · 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 913 · 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 922 · 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 930 · 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 939 · 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 947 · 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 956 · 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 964 · raw
@+yy:U32 -> U32
the days of February in a year
def when.short source · line 969 · raw
@+mo:U32 -> Bool
April, June, September and November have 30 days
def when.days.short source · line 974 · raw
@short:Bool -> U32
30 days in a short month and 31 in the others
def when.days.go source · line 982 · 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 990 · raw
@+yy:U32 -> @+mo:U32 -> U32
the days of month mo in year yy
def when.date.ok source · line 994 · 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 998 · 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 1002 · raw
@ww:WhenOut -> WhenOut
a local time uses a dummy date and then keeps only the clock
def when.day.end source · line 1016 · raw
@dd:Dig -> @yy:U32 -> @mo:U32 -> WhenOut
a complete date, then whatever follows it
def when.day.go source · line 1024 · raw
@hit:Bool -> @dd:Dig -> @yy:U32 -> @mo:U32 -> WhenOut
the day is two digits
def when.day source · line 1032 · raw
@cs:List<&2, Char> -> @yy:U32 -> @mo:U32 -> WhenOut
the day
def when.month.go source · line 1040 · raw
@dd:Dig -> @yy:U32 -> WhenOut
the dash after the month
def when.month source · line 1048 · raw
@hit:Bool -> @dd:Dig -> @yy:U32 -> WhenOut
the month
def when.year.dash source · line 1056 · raw
@cs:List<&2, Char> -> @yy:U32 -> WhenOut
the dash after the year
def when.year4 source · line 1064 · raw
@dd:Dig -> WhenOut
the fourth year digit, then the month
def when.year.more source · line 1072 · raw
@digit:Bool -> @nn:U32 -> @+cc:Char -> @tt:List<&2, Char> -> WhenOut
two more year digits, then a dash
def when.branch source · line 1080 · 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 1088 · raw
@cs:List<&2, Char> -> @nn:U32 -> WhenOut
two digits decide a time or a date
def when.after2 source · line 1096 · raw
@dd:Dig -> WhenOut
two digits decide a time (HH:) or a date (YYYY-)
def when.read source · line 1104 · raw
@cs:List<&2, Char> -> WhenOut
a datetime token
def word.dash.hit source · line 1108 · raw
@first:Bool -> @+cc:Char -> Bool
a dash after the first character
def word.or source · line 1116 · raw
@aa:Bool -> @bb:Bool -> Bool
either flag
def word.colon source · line 1124 · raw
@cs:List<&2, Char> -> Bool
a colon anywhere in the token
def word.ee.hit source · line 1132 · raw
@+cc:Char -> Bool
e or E: an exponent, so the token is a numeral rather than a datetime
def word.ee source · line 1136 · raw
@cs:List<&2, Char> -> Bool
whether the token holds an exponent marker
def word.as_date source · line 1144 · raw
@date:Bool -> @exp:Bool -> Bool
a datetime scan only when the token is not an exponent numeral
def word.dash source · line 1152 · raw
@cs:List<&2, Char> -> @first:Bool -> Bool
a dash after the first character
def word.spec.nan3 source · line 1160 · raw
@cc:Bool -> Got
a negative nan, or not a special
def word.spec.nan2 source · line 1168 · raw
@bb:Bool -> @cc:Bool -> Got
a signed nan
def word.spec.nan source · line 1176 · raw
@aa:Bool -> @bb:Bool -> @cc:Bool -> Got
nan
def str.eq.step source · line 1184 · raw
@aa:String -> @bb:String -> @same:Bool -> Bool
character-for-character equality. a mismatch drops the rest and stops
def str.eq source · line 1194 · 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 1198 · raw
@cc:Bool -> @+ss:String -> Got
a negative inf, or nan
def word.spec.inf2 source · line 1206 · raw
@bb:Bool -> @cc:Bool -> @+ss:String -> Got
a signed inf, or nan
def word.spec.inf source · line 1214 · raw
@aa:Bool -> @bb:Bool -> @cc:Bool -> @+ss:String -> Got
inf, or nan
def word.spec.f source · line 1222 · raw
@hit:Bool -> @+ss:String -> Got
false, or the rest of the specials
def word.spec.t source · line 1230 · raw
@hit:Bool -> @other:Bool -> @+ss:String -> Got
true, or the rest of the specials
def word.spec source · line 1238 · raw
@+ss:String -> Got
true, false, inf, and nan, including a sign on inf and nan
def word.from.when source · line 1242 · raw
@ww:WhenOut -> Got
a datetime result as a value
def word.body.put.sign source · line 1252 · 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 1260 · 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 1268 · raw
@lead:Bool -> @+cc:Char -> @out:List<&2, Char> -> List<&2, Char>
one character of a numeral spelling
def word.body.go source · line 1276 · 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 1284 · raw
@cs:List<&2, Char> -> String
the spelling of a numeral with the leading sign and underscores removed
def num.start source · line 1288 · raw
Num
a fresh numeral scan
def num.bad source · line 1292 · raw
@_st:Num -> @why:String -> Num
a scan that has failed
def num.sign source · line 1296 · raw
@_st:Num -> @sign:Sign -> Num
set the sign and wait for a digit
def num.digit.ok source · line 1300 · 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 1308 · raw
@st:Num -> @+cc:Char -> @nk:NK -> Num
a decimal digit joined to the numeral
def num.digit source · line 1313 · raw
@st:Num -> @+cc:Char -> @nk:NK -> Num
a decimal digit joined to the numeral
def num.us.go source · line 1317 · 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 1325 · raw
@st:Num -> Num
an underscore between digits
def num.base source · line 1330 · raw
@st:Num -> @base:U32 -> Num
the base prefix after a leading zero
def num.dot.go source · line 1335 · raw
@ok:Bool -> @sign:Sign -> Num
a dot begins the fraction
def num.dot source · line 1343 · raw
@st:Num -> Num
a dot begins the fraction
def num.exp.go source · line 1348 · raw
@ok:Bool -> @sign:Sign -> Num
an exponent marker
def num.exp source · line 1356 · raw
@st:Num -> Num
an exponent marker
def num.sign.of source · line 1361 · raw
@st:Num -> Sign
the sign already chosen
def num.lead.digit source · line 1366 · raw
@digit:Bool -> @st:Num -> @+cc:Char -> Num
a first digit
def num.lead.zero source · line 1374 · raw
@zero:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
a leading zero, or another digit
def num.lead.minus source · line 1382 · 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 1390 · 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 1398 · raw
@st:Num -> @+cc:Char -> Num
the first character after an optional sign
def num.after.sign.go source · line 1404 · 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 1412 · raw
@st:Num -> @+cc:Char -> Num
the character after a sign
def num.zero.exp2 source · line 1417 · 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 1425 · 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 1433 · 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 1441 · 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 1449 · 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 1457 · 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 1465 · raw
@st:Num -> @+cc:Char -> Num
the character after a lone zero
def num.digs.exp2 source · line 1470 · raw
@ee:Bool -> @st:Num -> @_c:Char -> Num
a capital exponent, or a rejected character
def num.digs.exp source · line 1478 · raw
@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an exponent
def num.digs.dot source · line 1486 · raw
@dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
a dot or an exponent
def num.digs.us source · line 1494 · 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 1502 · 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 1510 · raw
@st:Num -> @+cc:Char -> Num
a decimal digit, an underscore, a dot, or an exponent
def num.based.go source · line 1515 · raw
@us:Bool -> @st:Num -> @+cc:Char -> Num
an underscore, or a digit of the base
def num.based source · line 1523 · raw
@st:Num -> @+cc:Char -> Num
a digit of a prefixed integer, or an underscore
def num.frac.exp2 source · line 1527 · raw
@ee:Bool -> @st:Num -> @_c:Char -> Num
a capital exponent, or a rejected character
def num.frac.exp source · line 1535 · raw
@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num
an exponent in a fraction
def num.frac.us source · line 1543 · 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 1551 · 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 1559 · raw
@st:Num -> @+cc:Char -> Num
a fraction digit, an underscore, or an exponent
def num.exp.sign source · line 1564 · raw
@st:Num -> Num
the exponent sign is part of the spelling; digits follow
def num.expon.digit source · line 1569 · raw
@digit:Bool -> @st:Num -> @+cc:Char -> Num
a digit of the exponent
def num.expon.minus source · line 1577 · raw
@minus:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num
a minus or a digit in an exponent
def num.expon.go source · line 1585 · 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 1593 · raw
@st:Num -> @+cc:Char -> Num
the sign or the first digit of an exponent
def num.edig.us source · line 1597 · raw
@us:Bool -> @st:Num -> @_c:Char -> Num
an underscore in an exponent
def num.edig.go source · line 1605 · raw
@digit:Bool -> @us:Bool -> @st:Num -> @+cc:Char -> Num
an exponent digit or an underscore
def num.edig source · line 1613 · raw
@st:Num -> @+cc:Char -> Num
an exponent digit or an underscore
def num.on source · line 1617 · raw
@nk:NK -> @st:Num -> @+cc:Char -> Num
one character of a numeral
def num.step.go source · line 1639 · raw
@st:Num -> @+cc:Char -> Num
one character of a numeral
def num.step source · line 1644 · raw
@st:Num -> @+cc:Char -> Num
one character of a numeral
def num.go source · line 1648 · raw
@cs:List<&2, Char> -> @st:Num -> Num
the walk over a numeral
def i64.limit source · line 1656 · raw
@sign:Sign -> String
the positive limit is 2^63-1; the negative limit is 2^63
def i64.ord source · line 1664 · raw
@seen:Cmp -> @now:Cmp -> Cmp
the first differing digit stands; a tie takes the new order
def i64.step source · line 1675 · 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 1687 · raw
@+sign:Sign -> @+digits:String -> Bool
whether the integer fits in a signed 64-bit integer
def num.fin.range source · line 1691 · raw
@ok:Bool -> @sign:Sign -> @digits:String -> Got
an integer inside the signed 64-bit range
def num.fin.int source · line 1699 · 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 1707 · raw
@saw:Bool -> @val:Val -> Got
a numeral needs a digit in its last run
def num.signed source · line 1715 · raw
@cs:List<&2, Char> -> Bool
a prefixed integer may not carry a sign
def num.fin.base source · line 1723 · 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 1731 · 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 1753 · 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 1761 · raw
@st:Num -> @cs:List<&2, Char> -> Got
the value of a finished numeral
def word.num source · line 1766 · raw
@+cs:List<&2, Char> -> Got
a numeral token
def word.route.date source · line 1770 · 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 1778 · raw
@gg:Got -> @date:Bool -> @+cs:List<&2, Char> -> Got
a special word, or a numeral
def word.special.minus source · line 1786 · raw
@+cc:Char -> Bool
'-' can start a signed inf or nan
def word.special.plus source · line 1790 · raw
@hit:Bool -> @+cc:Char -> Bool
'+' or '-'
def word.special.n source · line 1798 · raw
@hit:Bool -> @+cc:Char -> Bool
'n', or a sign
def word.special.i source · line 1806 · raw
@hit:Bool -> @+cc:Char -> Bool
'i', or nan, or a sign
def word.special.f source · line 1814 · raw
@hit:Bool -> @+cc:Char -> Bool
'f', or inf, or nan, or a sign
def word.special.t source · line 1822 · raw
@hit:Bool -> @+cc:Char -> Bool
't', or false, or inf, or nan, or a sign
def word.special source · line 1830 · raw
@+cc:Char -> Bool
whether this character can start a special bare word
def word.lead source · line 1834 · raw
@cs:List<&2, Char> -> Bool
the first character, when the word has one
def word.val.num source · line 1842 · raw
@+cs:List<&2, Char> -> Got
a numeral or a datetime. the token cannot be a keyword
def word.val.pick source · line 1846 · 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 1855 · raw
@+cs:List<&2, Char> -> Got
a bare word: a special, a datetime, or a numeral
def err.first.go source · line 1893 · raw
@empty:Bool -> @bad:String -> @why:String -> String
the first error is kept
def err.first source · line 1901 · raw
@+bad:String -> @why:String -> String
the first error is kept
def find.step source · line 1905 · raw
@eq:Bool -> @vv:Val -> @more:(@_:Unit -> Hit) -> Hit
a key found earlier wins
def rows.find source · line 1913 · raw
@rows:List<&2, Val> -> @+name:String -> Hit
the first pair of this name
def get source · line 1923 · raw
@rows:List<&2, Val> -> @+name:String -> Hit
the value written for a key, or Miss
def rows.repl.step source · line 1927 · 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 1935 · raw
@rows:List<&2, Val> -> @+name:String -> @+val:Val -> List<&2, Val>
replace every pair of this name
def heads.or source · line 1945 · raw
@aa:Bool -> @bb:Bool -> Bool
either flag
def heads.by.head source · line 1954 · 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 1958 · raw
@path:String -> String
a table dotted keys defined, as heads records it
def heads.has source · line 1962 · 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 1972 · raw
@hs:List<&2, String> -> @+pp:String -> Bool
whether a table path was defined by a header
def heads.drop.step source · line 1982 · 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 1996 · 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 2006 · 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 2014 · 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 2022 · raw
@empty:Bool -> @pre:String -> @name:String -> String
a dotted path from a prefix and one segment
def tree.pre source · line 2030 · raw
@+pre:String -> @name:String -> String
a dotted path from a prefix and one segment
def look.of source · line 2034 · raw
@vv:Val -> Look
the value a key already holds
def look.step source · line 2046 · raw
@eq:Bool -> @vv:Val -> @more:(@_:Unit -> Look) -> Look
the matching pair, or the rest of the table
def rows.look source · line 2054 · raw
@rows:List<&2, Val> -> @+name:String -> Look
what a key in this table refers to
def look.last.one source · line 2064 · 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 2072 · 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 2082 · 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 2092 · 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 2100 · 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 2116 · 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 2134 · 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 2158 · 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 2170 · 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 2193 · 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 2205 · 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 2223 · 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 2240 · raw
@name:String -> @tw:Tw -> End
the key at the end of the path
def tree.sub.aots source · line 2245 · raw
@last:Last -> @+name:String -> @+vs:List<&2, Val> -> @job:Job -> @stack:List<&2, Fr> -> @+pre:String -> @heads:List<&2, String> -> @inl:Bool -> @path:String -> Tw
enter the last element of an array of tables
def tree.sub.job source · line 2264 · 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 2272 · raw
@job:Job -> Bool
a segment of a dotted key, which defines tables as it goes
def tree.sub.head.go source · line 2280 · raw
@shut:Bool -> @path:String -> @rows:List<&2, Val> -> @+name:String -> @vs:List<&2, Val> -> @+job:Job -> @stack:List<&2, Fr> -> @+pre:String -> @heads:List<&2, String> -> @inl:Bool -> @mark:Bool -> Tw
enter a table, unless a dotted key would add to a table a header defined
def tree.sub.head source · line 2301 · raw
@dot:Bool -> @path:String -> @rows:List<&2, Val> -> @+name:String -> @vs:List<&2, Val> -> @job:Job -> @stack:List<&2, Fr> -> @+pre:String -> @+heads:List<&2, String> -> @inl:Bool -> @mark:Bool -> Tw
a dotted key asks whether a header defined the table; a header walk does not
def tree.sub.arr source · line 2323 · raw
@dot:Bool -> @+path:String -> @elems:List<&2, Val> -> @+name:String -> @+vs:List<&2, Val> -> @job:Job -> @stack:List<&2, Fr> -> @+pre:String -> @heads:List<&2, String> -> @inl:Bool -> 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 2342 · raw
@hit:Look -> @+name:String -> @+vs:List<&2, Val> -> @+job:Job -> @stack:List<&2, Fr> -> @+pre:String -> @heads:List<&2, String> -> @+inl:Bool -> @+mark:Bool -> Tw
descend into one key, or record why it cannot be entered
def tree.sub.bad source · line 2370 · raw
@ok:Bool -> @+name:String -> @+vs:List<&2, Val> -> @job:Job -> @stack:List<&2, Fr> -> @bad:String -> @pre:String -> @heads:List<&2, String> -> @inl:Bool -> @mark:Bool -> Tw
descend into one key when the walk is still well
def tree.sub source · line 2389 · raw
@name:String -> @tw:Tw -> @mark:Bool -> Tw
descend into one key
def path.len source · line 2394 · raw
@xs:List<&2, String> -> @nn:U32 -> U32
how many segments are already the current table
def path.dec.z source · line 2402 · raw
@zz:Bool -> @skip:U32 -> U32
one fewer prefix segment, staying at zero
def path.dec source · line 2410 · raw
@+skip:U32 -> U32
one fewer prefix segment, staying at zero
def tree.walk.none source · line 2414 · raw
@tw:Tw -> End
an empty path records an error
def tree.walk source · line 2419 · 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 2431 · raw
@+cc:Char -> Bool
space or tab
def ch.space source · line 2435 · raw
@+cc:Char -> Bool
the space character itself, U+0020, the only one a datetime may hold
def ch.nl source · line 2439 · raw
@+cc:Char -> Bool
line feed or carriage return
def ch.ctl source · line 2443 · raw
@+cc:Char -> Bool
a control: U+0000 to U+001F, or U+007F
def ch.delim source · line 2447 · raw
@+cc:Char -> Bool
a character that ends a bare value
def ch.skip source · line 2452 · raw
@+cc:Char -> Bool
whitespace that a bare value swallows
def q.char source · line 2456 · raw
@kk:QKind -> Char
the quote character of a string kind
def q.multi source · line 2466 · raw
@kk:QKind -> Bool
a multiline string
def q.basic source · line 2476 · raw
@kk:QKind -> Bool
a basic string, which has escapes
def q.as.multi source · line 2486 · raw
@kk:QKind -> QKind
the multiline kind of a one-line kind
def date.mode source · line 2494 · raw
@pp:Char -> Bool
a pattern character that stands for a digit
def date.eq.go source · line 2498 · raw
@ok:Bool -> @more:(@_:Unit -> Bool) -> Bool
whether the rest of the shape matches
def date.step source · line 2506 · raw
@mode:Bool -> @digit:Bool -> @same:Bool -> @more:(@_:Unit -> Bool) -> Bool
one character of a date shape
def date.eq.nil source · line 2514 · raw
@pat:List<&2, Char> -> Bool
both lists ended together
def date.eq source · line 2522 · raw
@cs:List<&2, Char> -> @pat:List<&2, Char> -> Bool
YYYY-MM-DD, with D standing for a digit
def date.shaped source · line 2535 · raw
@buf:List<&2, Char> -> Bool
the buffer is a calendar date
def buf.str.go source · line 2539 · 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 2547 · raw
@buf:List<&2, Char> -> String
the buffer, in order
def span.str source · line 2551 · raw
@src:String -> @+nn:U32 -> @zz:Bool -> String
the first n characters of a source span
def span.rev source · line 2561 · 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 2571 · raw
@src:String -> Unit
the unread suffix of a span that will not be stored
def path.cat source · line 2579 · 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 2583 · raw
@nl:Bool -> @multi:Bool -> Bool
a multiline string keeps a newline
def str.bad.tab source · line 2591 · raw
@tab:Bool -> @nl:Bool -> @multi:Bool -> Bool
tab is kept
def str.bad.go source · line 2599 · raw
@ctrl:Bool -> @tab:Bool -> @nl:Bool -> @multi:Bool -> Bool
a raw control is rejected
def str.bad source · line 2607 · 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 2612 · raw
@st:St -> @why:String -> St
the scanner has failed
def st.lex source · line 2619 · raw
@st:St -> @lex:Lex -> St
replace the lex state
def st.hold source · line 2626 · raw
@st:St -> @+lex:Lex -> @cc:Char -> St
hold one character and set the lex state
def st.push source · line 2633 · raw
@st:St -> @cc:Char -> @lex:Lex -> St
append one character
def seg.push source · line 2640 · raw
@st:St -> @lex:Lex -> St
the segment in the buffer joins the key, and the buffer is cleared
def take.root source · line 2647 · 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 2662 · raw
@end:End -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @+here:List<&2, String> -> @+parts:List<&2, String> -> @rest:List<&2, Ctx> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> St
a finished value inside an inline table
def take.top source · line 2681 · 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> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> St
place a finished value into the current table, array, or inline table
def val.take source · line 2711 · raw
@st:St -> @val:Val -> St
place a finished value
def bare.hold.on source · line 2718 · raw
@st:St -> @cc:Char -> St
hold the delimiter when the following state must see it
def bare.line.lex source · line 2726 · 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 2734 · raw
@st:St -> St
a consumed newline returns to the top level after a root value
def bare.line source · line 2741 · raw
@st:St -> @nl:Bool -> St
a consumed newline returns to the top level after a root value
def bare.hold source · line 2749 · raw
@st:St -> @cc:Char -> @hold:Bool -> St
hold the delimiter when the following state must see it
def bare.got source · line 2757 · raw
@gg:Got -> @st:St -> @cc:Char -> @hold:Bool -> St
a bare word has been classified
def bare.finish source · line 2765 · 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 2773 · 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 2779 · raw
@arr:Bool -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @+segs:List<&2, String> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @lead:Bool -> St
an array-of-tables header, or a table header
def head.on source · line 2802 · 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 2808 · raw
@empty:Bool -> @st:St -> @segs:List<&2, String> -> St
the header key is ready
def head.use source · line 2816 · raw
@st:St -> St
the segment was pushed
def head.fin.buf source · line 2824 · raw
@empty:Bool -> @st:St -> St
the buffer is the last segment when it holds one
def head.fin source · line 2832 · raw
@st:St -> St
push a trailing segment, then open the header
def arr.top source · line 2840 · raw
@stack:List<&2, Ctx> -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> St
close an array and place it
def arr.close source · line 2861 · raw
@st:St -> St
close an array and place it
def inl.seal source · line 2868 · 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 2878 · raw
@stack:List<&2, Ctx> -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @back:Lex -> @qkind:QKind -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> St
close an inline table and place it
def inl.close source · line 2899 · raw
@st:St -> St
close an inline table and place it
def inl.open source · line 2905 · raw
@stack:List<&2, Ctx> -> Bool
the innermost frame is an inline table
def str.fin source · line 2913 · raw
@st:St -> St
a string is finished
def mq.put source · line 2920 · 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 2928 · raw
@+uu:U32 -> Bool
a code point may be written as a character
def uni.finish.on source · line 2933 · raw
@st:St -> @uu:U32 -> @back:Lex -> St
a finished unicode escape written into the buffer
def uni.finish source · line 2940 · raw
@ok:Bool -> @st:St -> @uu:U32 -> @back:Lex -> St
a finished unicode escape
def uni.next.more source · line 2948 · raw
@st:St -> @uu:U32 -> @left:U32 -> St
another hex digit is still required
def uni.next source · line 2955 · 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 2963 · 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 2971 · raw
@st:St -> @+cc:Char -> @back:Lex -> St
one hex digit of a unicode escape
def esc.uu source · line 2979 · raw
@uu:Bool -> Esc
a long unicode escape, or an unknown escape
def esc.u source · line 2987 · raw
@uuu:Bool -> @uu:Bool -> Esc
a unicode escape
def esc.r source · line 2995 · raw
@rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
carriage return or a unicode escape
def esc.f source · line 3003 · raw
@ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
form feed or the rest
def esc.n source · line 3011 · raw
@nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
newline or the rest
def esc.t source · line 3019 · 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 3027 · 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 3035 · 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 3043 · raw
@nl:Bool -> @sp:Bool -> @bb:Bool -> @tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc
a line-ending backslash, or a letter
def esc.bs source · line 3051 · raw
@bs:Bool -> @bb:Bool -> @tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> @nl:Bool -> @sp:Bool -> Esc
a backslash or a letter
def esc.of.go source · line 3059 · raw
@qq:Bool -> @bs:Bool -> @bb:Bool -> @tt:Bool -> @nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> @nl:Bool -> @sp:Bool -> Esc
a quote, a backslash, or a letter
def esc.of source · line 3079 · raw
@+cc:Char -> Esc
classify one escaped character
def esc.uni.lex source · line 3085 · raw
@back:Lex -> Lex
the lex state that reads the hex digits of an escape
def esc.uni source · line 3095 · raw
@st:St -> @back:Lex -> @nn:U32 -> St
a unicode escape starts with no digits seen
def esc.fold.bit source · line 3102 · raw
@saw:Bool -> U32
1 once a newline has been seen
def esc.fold.on source · line 3110 · raw
@st:St -> @saw:Bool -> St
a line-ending backslash skips following whitespace
def esc.fold.kind source · line 3117 · 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 3125 · raw
@st:St -> @saw:Bool -> St
a line-ending backslash is only part of a multiline string
def esc.fold.use source · line 3132 · raw
@back:Lex -> @st:St -> @saw:Bool -> St
a line-ending backslash is only part of a string
def esc.use source · line 3140 · raw
@ee:Esc -> @st:St -> @back:Lex -> St
apply one escape and return to the string
def com.enter source · line 3152 · raw
@st:St -> @back:Lex -> St
the lex state a comment returns to
def lex.top.bare source · line 3159 · raw
@bare:Bool -> @st:St -> @cc:Char -> St
a bare key, or a rejected character
def lex.bracket source · line 3167 · raw
@st:St -> St
a header starts with a clear key
def lex.qkey source · line 3174 · raw
@st:St -> @kind:QKind -> @lex:Lex -> St
a quoted key starts with an empty buffer
def lex.top.lit source · line 3181 · raw
@lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
a literal key or a bare key
def lex.top.q source · line 3189 · 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 3197 · 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 3205 · 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 3213 · 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 3221 · raw
@sp:Bool -> @nl:Bool -> @hash:Bool -> @br:Bool -> @qq:Bool -> @lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St
whitespace, a comment, a header, or a key
def lex.top source · line 3229 · raw
@st:St -> @+cc:Char -> St
top level: a key, a header, a comment, or whitespace
def lex.key.nl source · line 3234 · raw
@nl:Bool -> @st:St -> @_c:Char -> St
a newline before equals is rejected
def lex.key.end.go source · line 3242 · raw
@empty:Bool -> @st:St -> @lex:Lex -> St
an empty segment is rejected
def lex.key.end source · line 3250 · raw
@st:St -> @next:Lex -> St
end a nonempty segment
def lex.key.hash source · line 3258 · 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 3266 · raw
@eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @+cc:Char -> St
an equals ends the key
def lex.key.dot source · line 3274 · 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 3282 · 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 3290 · 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 3298 · raw
@st:St -> @+cc:Char -> St
inside a bare key segment
def lex.after.nl source · line 3303 · raw
@nl:Bool -> @st:St -> @_c:Char -> St
a newline before equals is rejected
def lex.after.hash source · line 3311 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment waits for equals
def lex.after.eq source · line 3319 · raw
@eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
equals starts the value
def lex.after.dot source · line 3327 · 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 3335 · 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 3343 · raw
@st:St -> @+cc:Char -> St
after a key segment, before equals or a dot
def lex.val.nl3 source · line 3348 · raw
@inside:Bool -> @st:St -> St
a value starts on the line of its key
def lex.val.nl2 source · line 3356 · raw
@st:St -> @_c:Char -> St
a newline before a value is rejected
def lex.array source · line 3364 · raw
@st:St -> St
an array starts a frame and waits for a value
def lex.inline source · line 3371 · raw
@st:St -> St
an inline table starts a frame and waits for a key
def lex.val.inl source · line 3378 · raw
@inl:Bool -> @st:St -> @cc:Char -> St
an inline table, or a bare value
def lex.val.br source · line 3386 · raw
@br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
an array, or another value
def lex.val.lit source · line 3394 · raw
@lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
a literal string, or another value
def lex.val.q source · line 3402 · 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 3410 · 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 3418 · 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 3426 · raw
@sp:Bool -> @nl:Bool -> @hash:Bool -> @qq:Bool -> @lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St
whitespace or the value itself
def lex.val source · line 3434 · raw
@st:St -> @+cc:Char -> St
the start of a value
def lex.q.go source · line 3439 · 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 3447 · raw
@st:St -> @+cc:Char -> St
the first quote has been seen
def lex.multi source · line 3455 · raw
@st:St -> @kind:QKind -> St
a multiline string, about to trim one opening newline
def lex.q2.go source · line 3462 · 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 3470 · raw
@st:St -> @+cc:Char -> St
two quotes have been seen
def lex.trim.nl source · line 3478 · 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 3486 · 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 3494 · raw
@st:St -> @+cc:Char -> St
trim one opening newline of a multiline string
def lex.trim2.go source · line 3498 · raw
@lf:Bool -> @st:St -> @cc:Char -> St
the line feed of a CRLF opening newline
def lex.trim2 source · line 3506 · raw
@st:St -> @+cc:Char -> St
the line feed of a CRLF opening newline
def lex.str.char.go source · line 3510 · raw
@bad:Bool -> @st:St -> @cc:Char -> St
a forbidden control, or one character of the string
def lex.str.char source · line 3518 · raw
@multi:Bool -> @st:St -> @+cc:Char -> St
a raw character, rejected when it is a forbidden control
def lex.str.bs source · line 3522 · raw
@bs:Bool -> @multi:Bool -> @st:St -> @cc:Char -> @_kind:QKind -> St
an escape, or a plain character
def lex.str.esc source · line 3530 · 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 3538 · raw
@st:St -> @nn:U32 -> St
count closing quotes of a multiline string
def lex.str.quote source · line 3545 · 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 3553 · 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 3561 · raw
@st:St -> @+cc:Char -> St
inside a string
def lex.mq.shut source · line 3569 · 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 3576 · raw
@one:Bool -> @st:St -> St
the second quote waits; the third is a closing delimiter
def lex.mq.back source · line 3584 · 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 3591 · 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 3599 · raw
@st:St -> @+cc:Char -> St
one character while closing a multiline string
def lex.mq.more source · line 3607 · raw
@st:St -> @cc:Char -> St
a quote after the closing delimiter: the delimiter moves one quote on
def lex.mq.fin source · line 3614 · raw
@st:St -> @cc:Char -> St
the string ends before this character, which the next state reads
def lex.mq.room source · line 3618 · 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 3626 · 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 3634 · raw
@st:St -> @+cc:Char -> St
one character after a multiline string's closing delimiter
def lex.esc source · line 3642 · raw
@st:St -> @+cc:Char -> St
one escaped character
def lex.fold.saw source · line 3646 · raw
@st:St -> St
remember that a newline was seen
def lex.fold.end.go source · line 3653 · raw
@saw:Bool -> @st:St -> @cc:Char -> St
a character before the newline is rejected
def lex.fold.end source · line 3661 · raw
@st:St -> @cc:Char -> St
the next character ends the fold only after a newline
def lex.fold.nl source · line 3669 · 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 3677 · raw
@sp:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
more whitespace, or the next character of the string
def lex.fold source · line 3685 · raw
@st:St -> @+cc:Char -> St
whitespace after a line-ending backslash
def lex.bare.date.go source · line 3689 · 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 3697 · raw
@st:St -> @cc:Char -> St
a date may continue after one space
def lex.bare.hold source · line 3705 · 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 3709 · 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 3716 · raw
@sp:Bool -> @st:St -> @cc:Char -> St
a space may be the space inside a datetime
def lex.bare.go source · line 3724 · raw
@delim:Bool -> @sp:Bool -> @st:St -> @cc:Char -> St
a delimiter ends the token
def lex.bare source · line 3732 · raw
@st:St -> @+cc:Char -> St
a bare value
def lex.date.digit source · line 3736 · raw
@st:St -> @cc:Char -> St
the space and the digit belong to the datetime
def lex.date.go source · line 3743 · raw
@digit:Bool -> @st:St -> @cc:Char -> St
the character after the space of a possible datetime
def lex.date source · line 3751 · raw
@st:St -> @+cc:Char -> St
the character after the space of a possible datetime
def lex.com.nl source · line 3755 · raw
@st:St -> @cc:Char -> St
the newline is read again in the state that was waiting
def lex.com.tab source · line 3762 · raw
@tab:Bool -> @st:St -> St
tab is the one control a comment may hold
def lex.com.ctl source · line 3770 · raw
@ctl:Bool -> @tab:Bool -> @st:St -> St
any other character is part of the comment
def lex.com.go source · line 3778 · 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 3786 · raw
@st:St -> @+cc:Char -> St
a comment runs to the end of the line
def lex.head.arr source · line 3790 · raw
@st:St -> St
the header is an array of tables
def lex.head.br2 source · line 3797 · raw
@once:Bool -> @st:St -> St
one extra bracket
def lex.head.br.go source · line 3805 · raw
@fresh:Bool -> @once:Bool -> @st:St -> St
the second bracket is only legal at the start
def lex.head.br source · line 3813 · raw
@st:St -> St
[[ opens an array of tables when the key has not started
def lex.head.ch.go source · line 3822 · raw
@gap:Bool -> @st:St -> @cc:Char -> St
between segments a dot is required
def lex.head.ch source · line 3830 · 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 3840 · 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 3848 · raw
@st:St -> St
whitespace ends a segment when one is open
def lex.head.dot3 source · line 3856 · raw
@empty:Bool -> @st:St -> St
a dot with no segment is rejected
def lex.head.dot2 source · line 3864 · raw
@st:St -> St
a dot ends the open segment
def lex.head.close2 source · line 3872 · raw
@arr:Bool -> @st:St -> St
an array of tables still needs one ]
def lex.head.close.go source · line 3880 · raw
@empty:Bool -> @arr:Bool -> @st:St -> St
push the last segment when the buffer holds one
def lex.head.close source · line 3888 · raw
@st:St -> St
] closes, or waits for the second ] of an array of tables
def lex.head.hash source · line 3896 · raw
@hash:Bool -> @st:St -> St
a comment in a header
def lex.head.quote.go source · line 3905 · 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 3913 · raw
@st:St -> @kind:QKind -> St
a quoted header segment, right after the bracket
def lex.head.lit source · line 3922 · raw
@lit:Bool -> @hash:Bool -> @st:St -> St
a literal header segment or a comment
def lex.head.q source · line 3930 · 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 3938 · 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 3946 · 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 3954 · 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 3962 · raw
@bare:Bool -> @sp:Bool -> @dot:Bool -> @end:Bool -> @qq:Bool -> @lit:Bool -> @hash:Bool -> @st:St -> @cc:Char -> St
a bare character, whitespace, a dot, or the end
def lex.head.go source · line 3970 · raw
@br:Bool -> @bare:Bool -> @sp:Bool -> @dot:Bool -> @end:Bool -> @qq:Bool -> @lit:Bool -> @hash:Bool -> @st:St -> @cc:Char -> St
a second bracket, a key character, or whitespace
def lex.head source · line 3989 · raw
@st:St -> @+cc:Char -> St
inside a header
def lex.hgap.end source · line 3995 · raw
@end:Bool -> @hash:Bool -> @st:St -> St
the end, or a comment
def lex.hgap.dot source · line 4003 · raw
@dot:Bool -> @end:Bool -> @hash:Bool -> @st:St -> St
a dot starts the next segment
def lex.hgap source · line 4011 · 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 4019 · raw
@st:St -> @+cc:Char -> St
between header segments
def lex.hdot.lit source · line 4023 · raw
@lit:Bool -> @st:St -> @_c:Char -> St
a literal segment, or a rejected character
def lex.hdot.q source · line 4031 · raw
@qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St
a quoted segment
def lex.hdot.bare source · line 4039 · raw
@bare:Bool -> @qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St
a bare segment or a quoted one
def lex.hdot source · line 4047 · 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 4055 · raw
@st:St -> @+cc:Char -> St
after a dot, a segment must start
def lex.kq.char.go source · line 4059 · 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 4067 · raw
@st:St -> @+cc:Char -> @stay:Lex -> St
one character of a quoted key
def lex.kq.nl source · line 4071 · raw
@nl:Bool -> @st:St -> @+cc:Char -> @stay:Lex -> St
a newline in a key is rejected
def lex.esc.lex source · line 4079 · raw
@stay:Lex -> Lex
the escape state for a quoted key
def lex.kesc source · line 4087 · raw
@st:St -> @+stay:Lex -> St
the escape returns to the quoted key
def lex.kq.esc source · line 4094 · raw
@basic:Bool -> @st:St -> @stay:Lex -> St
only a basic key treats the backslash as an escape
def lex.kq.bs source · line 4102 · 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 4110 · raw
@st:St -> @next:Lex -> St
a quoted segment may be empty
def lex.kq.go source · line 4114 · 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 4122 · 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 4130 · raw
@end:Bool -> @st:St -> St
the second ] of an array of tables
def lex.head.r source · line 4138 · raw
@st:St -> @+cc:Char -> St
the second ] of an array of tables
def lex.arr.end source · line 4142 · raw
@end:Bool -> @st:St -> @cc:Char -> St
] closes; anything else is a value
def lex.arr.hash source · line 4150 · raw
@hash:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
a comment, the end, or a value
def lex.arr.nl source · line 4158 · 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 4166 · 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 4174 · raw
@st:St -> @+cc:Char -> St
an array waits for a value or ]
def lex.arrc.end source · line 4178 · raw
@end:Bool -> @st:St -> St
] closes the array
def lex.arrc.comma source · line 4186 · raw
@comma:Bool -> @end:Bool -> @st:St -> St
a comma waits for another value
def lex.arrc.hash source · line 4194 · 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 4202 · raw
@nl:Bool -> @hash:Bool -> @comma:Bool -> @end:Bool -> @st:St -> @cc:Char -> St
a newline is whitespace
def lex.arrc.go source · line 4210 · 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 4218 · raw
@st:St -> @+cc:Char -> St
after an array value: a comma, ], or whitespace
def lex.key.clear source · line 4223 · raw
@st:St -> St
a new key starts with an empty segment list
def lex.key.bare source · line 4230 · raw
@ok:Bool -> @st:St -> @cc:Char -> St
a bare character opens the key
def lex.key.lit source · line 4238 · raw
@lit:Bool -> @st:St -> @+cc:Char -> St
a literal quote or a bare character opens the key
def lex.key.q source · line 4246 · raw
@qq:Bool -> @st:St -> @+cc:Char -> St
a quote or a bare character opens the key
def lex.key.start source · line 4254 · raw
@st:St -> @+cc:Char -> St
the first character of a key inside an inline table
def lex.inl.nl source · line 4258 · raw
@nl:Bool -> @st:St -> @cc:Char -> St
a newline is rejected; anything else is a key
def lex.inl.end source · line 4266 · raw
@end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
} closes an empty inline table
def lex.inl.hash source · line 4274 · 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 4282 · 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 4290 · raw
@st:St -> @+cc:Char -> St
an inline table waits for a key or }
def lex.inlk.hash source · line 4294 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comment or a key
def lex.inlk.go source · line 4302 · raw
@sp:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
whitespace or a key
def lex.inlk source · line 4310 · raw
@st:St -> @+cc:Char -> St
after a comma, a key is required
def lex.inlc.nl source · line 4314 · raw
@nl:Bool -> @st:St -> St
a newline is rejected
def lex.inlc.end source · line 4322 · raw
@end:Bool -> @nl:Bool -> @st:St -> @_c:Char -> St
} closes the inline table
def lex.inlc.comma source · line 4330 · raw
@comma:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a comma requires another key
def lex.inlc.hash source · line 4338 · 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 4346 · 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 4354 · raw
@st:St -> @+cc:Char -> St
after an inline value: a comma or }
def lex.sink source · line 4359 · raw
@st:St -> @_c:Char -> St
the rest of a failed document is ignored
def lex.line.nl source · line 4363 · raw
@nl:Bool -> @st:St -> St
anything else on the same line is another expression
def lex.line.hash source · line 4371 · raw
@hash:Bool -> @nl:Bool -> @st:St -> @_c:Char -> St
a comment may follow an expression
def lex.line.go source · line 4379 · 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 4387 · 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 4391 · raw
@nl:Bool -> @st:St -> St
a newline in a dotted key is rejected
def lex.kdot.dot source · line 4399 · raw
@dot:Bool -> @nl:Bool -> @st:St -> St
a second dot is an empty segment
def lex.kdot.bare source · line 4407 · raw
@bare:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St
a bare character starts the segment
def lex.kdot.lit source · line 4415 · raw
@lit:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @+cc:Char -> St
a literal quote starts the segment
def lex.kdot.q source · line 4423 · 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 4431 · 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 4439 · raw
@st:St -> @+cc:Char -> St
after a dot, whitespace and then a segment
def lex.hq source · line 4444 · raw
@st:St -> @+cc:Char -> St
a quoted header segment
def read.on source · line 4448 · raw
@lex:Lex -> @st:St -> @cc:Char -> St
one character, dispatched on the lex state
def read.on.st source · line 4522 · raw
@st:St -> @cc:Char -> St
read the lex state and step
def read.step.bom source · line 4529 · raw
@bom:Bool -> @st:St -> @cc:Char -> St
one character, after a leading mark has been decided
def read.step.lead source · line 4537 · raw
@lead:Bool -> @st:St -> @+cc:Char -> St
the first character may be a byte-order mark
def read.step source · line 4545 · raw
@st:St -> @+cc:Char -> St
one character of the document
def read.once.hold source · line 4552 · raw
@hold:Hold -> @st:St -> St
a held character is read once
def read.once2 source · line 4560 · raw
@st:St -> St
a held character is read once
def read.once source · line 4567 · 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 4571 · 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 4585 · raw
@st:St -> St
a bare token still open at the end is closed
def rows.seal.fin source · line 4592 · 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 4600 · 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 4625 · raw
@rows:List<&2, Val> -> List<&2, Val>
insertion order of a table built newest-first
def read.fin.stack source · line 4629 · 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 4637 · raw
@st:St -> Doc
the document from a finished state
def read.fin.unclosed source · line 4643 · raw
@st:St -> Doc
an unfinished document keeps the first error
def read.fin.end source · line 4649 · raw
@lex:Lex -> Bool
a comment may end a document only where the line already could
def read.fin.com source · line 4661 · 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 4669 · 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 4676 · raw
@st:St -> Doc
any other state is unfinished
def read.fin.ok source · line 4680 · raw
@lex:Lex -> @st:St -> Doc
the states that may end a document
def read.fin2 source · line 4694 · raw
@st:St -> Doc
the document once the last token has been closed
def read.fin source · line 4701 · raw
@st:St -> Doc
the document at the end of the text
def read.fast.st source · line 4705 · raw
@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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> St
one scanner state, with the hold cleared and the first character already taken
def read.fast.cons source · line 4724 · raw
@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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
the character joins the buffer and the state stays
def read.fast.old source · line 4744 · raw
@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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
a quote, an escape, or a state this step does not special-case
def read.fast.push source · line 4764 · raw
@ctrl:Bool -> @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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
a forbidden control takes the full step; a plain character is stored
def read.fast.basic.bs source · line 4790 · raw
@bs:Bool -> @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 -> @+cc:Char -> St
a basic-string character that is not a quote
def read.fast.basic source · line 4814 · raw
@quote:Bool -> @bs:Bool -> @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 -> @+cc:Char -> St
a basic-string character: a quote or a backslash still takes the full step
def read.fast.lit source · line 4839 · raw
@quote:Bool -> @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 -> @+cc:Char -> St
a literal-string character: a quote still takes the full step
def read.fast.str source · line 4863 · raw
@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 -> @+cc:Char -> St
one character of a string
def read.fast.key source · line 4890 · raw
@ok:Bool -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @back:Lex -> @qkind:QKind -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
one character of a bare key
def read.fast.bare source · line 4915 · raw
@delim:Bool -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @back:Lex -> @qkind:QKind -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
one character of a bare value
def read.fast.com source · line 4940 · raw
@ctl:Bool -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @back:Lex -> @qkind:QKind -> @stack:List<&2, Ctx> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+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 4965 · raw
@keep:Bool -> @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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
whitespace that this state ignores. keep is true when a newline is also ignored
def read.fast.ws.nl source · line 4991 · raw
@nl:Bool -> @keep:Bool -> @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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
a newline this state ignores, or the full step
def read.fast.ws source · line 5018 · raw
@sp:Bool -> @nl:Bool -> @keep:Bool -> @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> -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @+cc:Char -> St
space stays in this state; a newline stays only when keep is set
def read.fast.lex source · line 5046 · raw
@lex:Lex -> @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 -> @+cc:Char -> St
the states whose plain characters do not change the scanner
def read.fast.lead source · line 5107 · raw
@lead:Bool -> @lex:Lex -> @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 -> @+cc:Char -> St
the first character may be a byte-order mark; later characters take the fast step
def read.fast.hold source · line 5133 · raw
@hold:Hold -> @lead:Bool -> @lex:Lex -> @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 -> @+cc:Char -> St
a held character is still read by the full step, then this character
def read.fast source · line 5160 · raw
@st:St -> @+cc:Char -> St
one source character
def eat.fin source · line 5180 · raw
@_n:U32 -> @_u:Unit -> @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 -> Doc
an unclosed string
def eat.close source · line 5198 · raw
@cut:String -> @nn: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 -> St
a plain string is the first n characters of the source suffix
def eat.copy source · line 5216 · raw
@+cc:Char -> @cut:String -> @+nn: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
an escape or a forbidden control copies the span so far and continues
def eat.ctrl source · line 5235 · raw
@badc:Bool -> @basic:Bool -> @qq:Char -> @cc:Char -> @cut:String -> @nn: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
a forbidden control leaves the span; a plain character extends it
def eat.bs source · line 5262 · raw
@bs:Bool -> @basic:Bool -> @qq:Char -> @+cc:Char -> @cut:String -> @nn: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
a backslash in a basic string leaves the span
def eat.basic source · line 5289 · raw
@basic:Bool -> @qq:Char -> @+cc:Char -> @cut:String -> @nn: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
a literal string keeps a backslash; a basic string does not
def eat.feed.q source · line 5315 · raw
@quote:Bool -> @basic:Bool -> @qq:Char -> @cc:Char -> @cut:String -> @nn: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
a quote closes the span
def eat.feed source · line 5342 · raw
@basic:Bool -> @+qq:Char -> @cut:String -> @nn: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 -> @+cc:Char -> Mode
one character of a plain string. cut is the suffix where the text began
def doc.open.eat source · line 5363 · raw
@_back:Lex -> @mode:Mode -> Mode
the opening quote's back state is not kept on the span
def doc.drop source · line 5367 · raw
@_tail:String -> @mode:Mode -> Mode
a suffix the span does not keep
def doc.open.buf source · line 5371 · raw
@basic:Bool -> @qq: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 -> @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 5398 · raw
@badc:Bool -> @basic:Bool -> @qq: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 -> @cc:Char -> @tail:String -> Mode
a forbidden control leaves the span
def doc.open.bs source · line 5426 · raw
@bs:Bool -> @qq: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 -> @+cc:Char -> @tail:String -> Mode
a backslash in a basic string leaves the span
def doc.open.b source · line 5453 · raw
@basic:Bool -> @qq: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 -> @+cc:Char -> @tail:String -> Mode
a literal string keeps a backslash; a basic string does not
def doc.open.q source · line 5480 · raw
@same:Bool -> @basic:Bool -> @qq: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 -> @cc:Char -> @tail:String -> Mode
a second quote is an empty string or the start of a multiline string
def doc.open source · line 5508 · raw
@basic:Bool -> @+qq: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 -> @+cc:Char -> @tail:String -> Mode
the character after an opening quote
def doc.scan.kind source · line 5530 · raw
@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
a one-line string may be a span; a multiline string stays on the old path
def doc.scan.lead source · line 5556 · raw
@lead:Bool -> @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
the first character of the file is still the old step
def doc.scan.hold source · line 5580 · raw
@hold:Hold -> @lead:Bool -> @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
a held character is not the start of a span
def doc.wrap.lex source · line 5605 · raw
@lex:Lex -> @bad:String -> @rows:List<&2, Val> -> @heads:List<&2, String> -> @here:List<&2, String> -> @parts:List<&2, String> -> @buf:List<&2, Char> -> @back:Lex -> @qkind:QKind -> @stack:List<&2, Ctx> -> @hold:Hold -> @uni:U32 -> @left:U32 -> @arrtab:Bool -> @lead:Bool -> Mode
a quote opened a one-line string, or the state is rebuilt around that quote
def doc.wrap source · line 5631 · raw
@st:St -> Mode
a quote may have opened a string
def doc.scan.cr source · line 5638 · raw
@cr:Bool -> @st:St -> @cc:Char -> Mode
a carriage return must be followed by a line feed
def doc.scan.sq source · line 5646 · raw
@sq:Bool -> @cr:Bool -> @st:St -> @cc:Char -> Mode
an apostrophe may open a literal string
def doc.scan.q source · line 5654 · 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 5662 · raw
@st:St -> @+cc:Char -> Mode
one source character outside a plain string
def doc.cr source · line 5667 · 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 5675 · 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 5703 · raw
St
a scanner at the start of a document
def span.esc source · line 5718 · raw
@+uu:U32 -> Bool
quote, backslash, or a control. those still take the escaping writer
def span.quote.push source · line 5723 · 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 5733 · raw
@acc:SqAcc -> Sq
the reversed body, or a stop, as the quoting result
def span.quote.go source · line 5741 · 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 5752 · 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 5760 · raw
@+src:String -> @+nn:U32 -> String
a plain string span, quoted without rebuilding an escaped copy
def render.bool source · line 5764 · raw
@bit:Bool -> String
true or false
def render.atom source · line 5772 · raw
@vv:Val -> String
a scalar value
def render.suf.last source · line 5790 · raw
@last:Bool -> @gap:String -> String
a separator that is omitted after the last item
def render.suf source · line 5798 · raw
@+gap:String -> @trail:Bool -> @last:Bool -> String
a separator. trail keeps the separator after the last item
def render.go source · line 5806 · 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 5839 · 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 5852 · raw
@_rows:List<&2, Val> -> @text:String -> String
the rows are already closed over by the nested rendering
def render.rest source · line 5856 · 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 5860 · 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 5878 · 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 5894 · 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 5912 · 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 5927 · 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 5966 · raw
@+vs:List<&2, Val> -> @+gap:String -> @+trail:Bool -> String
keys first, then tables and arrays of tables
def string source · line 5970 · raw
@vv:Val -> String
the text of a string value
def digits source · line 5980 · raw
@vv:Val -> String
the digits of an integer value
def flag source · line 5988 · raw
@vv:Val -> Bool
the bit of a boolean value
def at.rows source · line 5996 · raw
@vv:Val -> List<&2, Val>
the rows of a table value
def at.rows_of source · line 6008 · raw
@hh:Hit -> List<&2, Val>
the rows of a hit, when it is a table
def at.step source · line 6016 · raw
@rest:List<&2, String> -> @hit:Hit -> Hit
the rest of a path after the first key
def at source · line 6024 · raw
@rows:List<&2, Val> -> @path:List<&2, String> -> Hit
the value at a dotted path
def root source · line 6032 · raw
@doc:Doc -> List<&2, Val>
the root table
def bad source · line 6037 · raw
@doc:Doc -> String
the first error, or "" when the document is well formed
def str source · line 6042 · raw
@text:String -> Val
a string value
def integer source · line 6046 · raw
@sign:Sign -> @text:String -> Val
an integer value
def float source · line 6050 · raw
@sign:Sign -> @text:String -> Val
a float value
def boolean source · line 6054 · raw
@bit:Bool -> Val
a boolean value
def array source · line 6058 · raw
@items:List<&2, Val> -> Val
an array value
def inline source · line 6062 · raw
@rows:List<&2, Val> -> Val
an inline table
def table source · line 6066 · raw
@path:String -> @rows:List<&2, Val> -> Val
a table
def pair source · line 6070 · raw
@name:String -> @val:Val -> Val
a key and a value
def render source · line 6074 · raw
@doc:Doc -> String
a document written back as TOML
def parse source · line 6079 · raw
@text:String -> Doc
a document read from TOML text
def wf.then source · line 6108 · raw
@ok:Bool -> @more:(@_:Unit -> Bool) -> Bool
the rest when this part holds, and False otherwise
def wf.char source · line 6116 · raw
@+cc:Char -> Bool
a Unicode scalar value: no surrogate, and nothing past U+10FFFF
def wf.text source · line 6120 · raw
@ss:String -> Bool
every character of a string or a key is a Unicode scalar value
def wf.span source · line 6128 · 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 6138 · raw
@ss:String -> Bool
every character is an ASCII digit
def wf.dec.lead source · line 6146 · 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 6154 · raw
@ss:String -> Bool
decimal digits with no leading zero, except 0 itself
def wf.int source · line 6162 · raw
@+sign:Sign -> @+digits:String -> Bool
an integer: decimal digits within signed 64 bits
def wf.flo.is_e source · line 6166 · raw
@+cc:Char -> Bool
e or E
def wf.flo.tail source · line 6170 · raw
@+cc:Char -> Fl
after the integer part: a fraction or an exponent
def wf.flo.step source · line 6174 · raw
@st:Fl -> @+cc:Char -> Fl
one character of a float's spelling
def wf.flo.go source · line 6197 · raw
@cs:List<&2, Char> -> @st:Fl -> Fl
a float's spelling read from the given state
def wf.flo.end source · line 6205 · raw
@st:Fl -> Bool
a spelling ends after a fraction's digit or an exponent's digit
def wf.flo source · line 6215 · 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 6220 · 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 6225 · raw
@cc:Clock -> Bool
a time of day: hour, minute and second in range, and a fraction of digits
def wf.zone source · line 6230 · raw
@zz:Zone -> Bool
a zone offset in range
def wf.when source · line 6238 · raw
@ww:When -> Bool
a datetime whose fields are in range
def wf.atom source · line 6251 · 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 6269 · raw
@hit:Hit -> Bool
a name no later pair of the table has
def wf.key source · line 6277 · 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 6281 · 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 6290 · 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 6305 · 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 6313 · 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 6323 · 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 6331 · raw
@vs:List<&2, Val> -> @+at:WfAt -> Bool
a list of values, well-formed where it sits
def wf source · line 6366 · 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