~/bend-docscommunity

main.bend checks

raw source on the hub · import emerging-eztoml@0.8.0.0/main.bend as Main

eztoml: TOML for Bend 2, a proven parser and renderer for TOML documents.

eztoml reads and writes TOML documents. Values are strings, integers, floats, booleans, datetimes, arrays, inline tables, tables, and arrays of tables. Comments and blank lines are passed over.

parse, render, get, at, root, bad, string, digits, flag str, integer, float, boolean, array, inline, table, pair key, wf

1 import
import Base

Types

type Sign source · line 13 · raw

Data

the sign of an integer, a float, or a zone offset

type Date source · line 18 · raw

Data

a calendar date: year, month, day

type Clock source · line 22 · raw

Data

a time of day. frac is the fractional second, empty when there is none

type Zone source · line 26 · raw

Data

a zone offset: Z, or a numeric offset

type When source · line 31 · raw

Data

the four TOML datetime forms

type Val source · line 41 · raw

Data

one TOML value. Tables remember the dotted path they were opened under. An inline table is VInl. An array of tables is VAots, and each element is VAot. VPair is a key in a table. VSpan is a plain string: the first n characters of a source suffix.

type Hit source · line 56 · raw

Data

a key found in a table, or not

type Doc source · line 61 · raw

Data

a parsed document: the first error, and the root table in order

type Got source · line 65 · raw

Data

a value read from a bare word, or the reason it is not one

type Dig source · line 70 · raw

Data

digits taken from the front of a character list

type WhenOut source · line 75 · raw

Data

what a datetime scan produced

type NK source · line 81 · raw

Data

a decimal numeral being built, least-significant digit first

type Num source · line 93 · raw

Data

the numeral scan

type BK source · line 98 · raw

Data

how a basic-string character is written

type Lex source · line 104 · raw

Data

where the scanner is in a document

type QKind source · line 142 · raw

Data

which quotes a string is using

type Hold source · line 149 · raw

Data

one character to read again

type Ctx source · line 154 · raw

Data

an open array or inline table

type St source · line 159 · raw

Data

the scanner

type Esc source · line 166 · raw

Data

an escape in a basic string

type Job source · line 1861 · raw

Data

a change applied at the end of a key path

type Fr source · line 1867 · raw

Data

one table the walk has entered

type Tw source · line 1873 · raw

Data

the walk: the table being edited, and the frames above it

type End source · line 1878 · raw

Data

the root table after a walk

type Look source · line 1882 · raw

Data

what a key in a table refers to

type Last source · line 1890 · raw

Data

the last element of an array of tables

type Mode source · line 5170 · 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

type Sq source · line 5710 · raw

Data

a span walked for quoting. SqOk is the body reversed, with the closing quote already on

type SqAcc source · line 5715 · raw

Data

the reversed body while a span is still plain. SqStop means an escape was seen

type WfAt source · line 6090 · 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

type Fl source · line 6098 · 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 ] )

Definitions

def bare.at source · line 173 · raw

@+cc:Char -> Bool

a character a bare key may hold

def bare.all.step source · line 178 · raw

@here:Bool -> @rest:(@_:Unit -> Bool) -> Bool

one step of the bare-key walk, with the head's answer in hand

def bare.all source · line 186 · raw

@cs:List<&2, Char> -> Bool

whether every character of a key is one a bare key may hold

def bare source · line 194 · raw

@+ss:String -> Bool

whether a key can be written without quotes

def hex.char.go source · line 198 · raw

@dec:Bool -> @nn:U32 -> Char

one hex nibble as a character

def hex.char source · line 206 · raw

@+nn:U32 -> Char

one hex nibble as a character

def basic.hex source · line 210 · raw

@+uu:U32 -> @out:List<&2, Char> -> List<&2, Char>

four lowercase hex digits of a code point, then the \u introducer, reversed

def basic.esc source · line 216 · raw

@mark:Char -> @out:List<&2, Char> -> List<&2, Char>

an escape mark reversed onto the output: the mark, then the backslash

def basic.cls.hex source · line 220 · raw

@hit:Bool -> BK

other controls are \u escapes; the rest are themselves

def basic.cls.bslash source · line 228 · raw

@hit:Bool -> @+uu:U32 -> BK

backslash

def basic.cls.quote source · line 236 · raw

@hit:Bool -> @+uu:U32 -> BK

quotation mark

def basic.cls.cr source · line 244 · raw

@hit:Bool -> @+uu:U32 -> BK

carriage return

def basic.cls.ff source · line 252 · raw

@hit:Bool -> @+uu:U32 -> BK

form feed

def basic.cls.lf source · line 260 · raw

@hit:Bool -> @+uu:U32 -> BK

line feed

def basic.cls.tab source · line 268 · raw

@hit:Bool -> @+uu:U32 -> BK

tab

def basic.cls.bs source · line 276 · raw

@hit:Bool -> @+uu:U32 -> BK

backspace, then the rest

def basic.cls source · line 284 · raw

@+uu:U32 -> BK

the class of a code point in a basic string

def basic.disp source · line 288 · raw

@kk:BK -> @cc:Char -> @uu:U32 -> @out:List<&2, Char> -> List<&2, Char>

one character of a basic string, reversed onto the output

def basic.one source · line 298 · raw

@+cc:Char -> @out:List<&2, Char> -> List<&2, Char>

one character of a basic string

def basic.go source · line 303 · raw

@cs:List<&2, Char> -> @out:List<&2, Char> -> List<&2, Char>

the escaped characters of a basic string, reversed

def key.basic source · line 311 · raw

@+ss:String -> String

a basic string: quotes, with controls and quotes escaped

def key.go source · line 316 · raw

@ok:Bool -> @+ss:String -> String

bare when the name allows it, otherwise a basic string

def key source · line 324 · raw

@+ss:String -> String

a key as TOML writes it

def dec.carry.c0 source · line 328 · raw

@zz:Bool -> @cc:U32 -> List<&2, U32>

the overflow of a decimal step, least-significant digit first

def dec.carry.c source · line 336 · raw

@+cc:U32 -> List<&2, U32>

the overflow of a decimal step

def dec.carry.b0 source · line 340 · raw

@zz:Bool -> @+cc:U32 -> List<&2, U32>

the next digit of an overflow

def dec.carry.b source · line 348 · raw

@+cc:U32 -> List<&2, U32>

the next digit of an overflow

def dec.carry.a source · line 352 · raw

@zz:Bool -> @+cc:U32 -> List<&2, U32>

the first digit of an overflow

def dec.carry source · line 360 · raw

@+cc:U32 -> List<&2, U32>

the digits of a leftover carry

def dec.go source · line 364 · 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 373 · raw

@dd:U32 -> Char

a digit character

def dec.chars source · line 377 · raw

@ds:List<&2, U32> -> List<&2, Char>

digits as characters, in the order given

def dec.drop.lead source · line 385 · raw

@lead:Bool -> @+hh:Char -> Bool

whether a leading zero is still being skipped

def dec.drop.outz source · line 393 · 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 401 · raw

@lead:Bool -> @+hh:Char -> @out:List<&2, Char> -> List<&2, Char>

the output after one character, reversed

def dec.drop.end source · line 409 · raw

@lead:Bool -> @out:List<&2, Char> -> String

the numeral, or 0 when every digit was zero

def dec.drop source · line 417 · 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 425 · raw

@ds:List<&2, U32> -> String

a decimal numeral. The digit list is least-significant first

def dig.up source · line 429 · 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 437 · raw

@ok:Bool -> @+uu:U32 -> U32

a lowercase hex digit, otherwise an uppercase one

def dig.dec source · line 445 · raw

@ok:Bool -> @+uu:U32 -> U32

a decimal digit, otherwise a hex letter

def dig.val source · line 453 · raw

@+cc:Char -> U32

the value of a digit character, or 99

def dig.ok source · line 458 · raw

@dd:U32 -> @base:U32 -> Bool

whether a digit value fits a base

def take.acc.d source · line 462 · raw

@digit:Bool -> @nn:U32 -> @+cc:Char -> U32

exactly k digits, or DigBad

def take.acc source · line 470 · raw

@ok:Bool -> @nn:U32 -> @+cc:Char -> U32

the accumulator after one character

def take.ok source · line 478 · raw

@ok:Bool -> @+cc:Char -> Bool

the scan stays well only while every character is a digit

def take.fin source · line 486 · raw

@ok:Bool -> @nn:U32 -> @cs:List<&2, Char> -> Dig

the finished take

def take.n source · line 494 · 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 506 · raw

@+nn:U32 -> @lo:U32 -> @hi:U32 -> Bool

a number is inside the inclusive bounds

def pad2.go source · line 510 · raw

@small:Bool -> @nn:U32 -> String

two digits, zero padded

def text.pad2 source · line 518 · raw

@+nn:U32 -> String

two digits, zero padded

def pad4.big source · line 522 · raw

@nn:U32 -> @big:Bool -> String

the one-zero pad, or the digits themselves

def pad4.mid source · line 530 · raw

@nn:U32 -> @mid:Bool -> @big:Bool -> String

the three-digit and two-digit pads

def pad4.go source · line 538 · raw

@nn:U32 -> @small:Bool -> @mid:Bool -> @big:Bool -> String

four digits, zero padded

def text.pad4 source · line 546 · raw

@+nn:U32 -> String

four digits, zero padded

def zone.mark source · line 550 · raw

@sign:Sign -> String

the sign of a zone offset

def zone.shift source · line 558 · raw

@sign:Sign -> @hh:U32 -> @mi:U32 -> String

a numeric zone offset

def zone.text source · line 562 · raw

@zz:Zone -> String

a zone suffix

def clock.frac.go source · line 570 · raw

@empty:Bool -> @frac:String -> String

the fractional second, or nothing

def clock.frac source · line 578 · raw

@+frac:String -> String

the fractional second, or nothing

def clock.text source · line 582 · raw

@cc:Clock -> String

a clock, with a fractional second when it has one

def date.text source · line 587 · raw

@dd:Date -> String

a date

def when.text source · line 592 · raw

@ww:When -> String

a datetime in TOML spelling

def sign.text source · line 604 · raw

@sign:Sign -> String

the sign of an integer or a float, empty when it is positive

def cs.some source · line 612 · raw

@cs:List<&2, Char> -> Bool

whether the list still has a character

def cs.head source · line 620 · raw

@cs:List<&2, Char> -> Char

one character, when the list has one

def cs.tail source · line 628 · raw

@cs:List<&2, Char> -> List<&2, Char>

the tail of a list

def clock.with source · line 636 · raw

@cc:Clock -> @frac:String -> Clock

a clock with its fraction filled in

def when.done source · line 641 · 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 645 · raw

@tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut

Z ends the token

def when.zone.mm.ok2 source · line 653 · 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 661 · 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 669 · 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 686 · raw

@dd:Dig -> @sign:Sign -> @+hh:U32 -> @clock:Clock -> @date:Date -> WhenOut

the offset minute is in range

def when.zone.mm source · line 694 · raw

@hit:Bool -> @dd:Dig -> @sign:Sign -> @hh:U32 -> @clock:Clock -> @date:Date -> WhenOut

the offset minute

def when.zone.hh.colon source · line 702 · 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 710 · raw

@dd:Dig -> @sign:Sign -> @clock:Clock -> @date:Date -> WhenOut

the offset hour

def when.zone.off source · line 718 · raw

@sign:Sign -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut

HH:MM of a numeric offset

def when.zone.minus source · line 722 · raw

@minus:Bool -> @tt:List<&2, Char> -> @clock:Clock -> @date:Date -> WhenOut

a minus starts a numeric offset

def when.zone.sign source · line 730 · 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 738 · 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 746 · 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 755 · 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 764 · 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 768 · 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 784 · raw

@cs:List<&2, Char> -> @+rev:List<&2, Char> -> @+clock:Clock -> @+date:Date -> WhenOut

fractional digits

def when.frac.go source · line 793 · 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 801 · raw

@cs:List<&2, Char> -> @+clock:Clock -> @+date:Date -> WhenOut

an optional fractional second

def when.clock.range.s source · line 809 · 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 817 · 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 825 · 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 842 · raw

@dd:Dig -> @+hh:U32 -> @+mi:U32 -> @date:Date -> WhenOut

seconds, then an optional fraction and zone

def when.clock.ss source · line 851 · raw

@hit:Bool -> @dd:Dig -> @hh:U32 -> @mi:U32 -> @date:Date -> WhenOut

seconds after the colon

def when.clock.mm.colon source · line 859 · raw

@cs:List<&2, Char> -> @hh:U32 -> @mi:U32 -> @date:Date -> WhenOut

the colon after the minutes

def when.clock.mm source · line 867 · raw

@dd:Dig -> @hh:U32 -> @date:Date -> WhenOut

minutes, then seconds

def when.clock.colon.go source · line 875 · raw

@hit:Bool -> @hh:U32 -> @tt:List<&2, Char> -> @date:Date -> WhenOut

the colon after the hour

def when.clock.colon source · line 883 · raw

@cs:List<&2, Char> -> @hh:U32 -> @date:Date -> WhenOut

the colon after the hour

def when.clock.of source · line 891 · raw

@dd:Dig -> @date:Date -> WhenOut

a clock following a date

def when.after.sp source · line 899 · raw

@sp:Bool -> @date:Date -> @tt:List<&2, Char> -> WhenOut

a space separates a date from a time

def when.after.sep source · line 907 · 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 915 · 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 924 · 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 932 · 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 941 · 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 949 · 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 958 · 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 966 · raw

@+yy:U32 -> U32

the days of February in a year

def when.short source · line 971 · raw

@+mo:U32 -> Bool

April, June, September and November have 30 days

def when.days.short source · line 976 · raw

@short:Bool -> U32

30 days in a short month and 31 in the others

def when.days.go source · line 984 · 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 992 · raw

@+yy:U32 -> @+mo:U32 -> U32

the days of month mo in year yy

def when.date.ok source · line 996 · 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 1000 · 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 1004 · raw

@ww:WhenOut -> WhenOut

a local time uses a dummy date and then keeps only the clock

def when.day.end source · line 1018 · raw

@dd:Dig -> @yy:U32 -> @mo:U32 -> WhenOut

a complete date, then whatever follows it

def when.day.go source · line 1026 · raw

@hit:Bool -> @dd:Dig -> @yy:U32 -> @mo:U32 -> WhenOut

the day is two digits

def when.day source · line 1034 · raw

@cs:List<&2, Char> -> @yy:U32 -> @mo:U32 -> WhenOut

the day

def when.month.go source · line 1042 · raw

@dd:Dig -> @yy:U32 -> WhenOut

the dash after the month

def when.month source · line 1050 · raw

@hit:Bool -> @dd:Dig -> @yy:U32 -> WhenOut

the month

def when.year.dash source · line 1058 · raw

@cs:List<&2, Char> -> @yy:U32 -> WhenOut

the dash after the year

def when.year4 source · line 1066 · raw

@dd:Dig -> WhenOut

the fourth year digit, then the month

def when.year.more source · line 1074 · raw

@digit:Bool -> @nn:U32 -> @+cc:Char -> @tt:List<&2, Char> -> WhenOut

two more year digits, then a dash

def when.branch source · line 1082 · 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 1090 · raw

@cs:List<&2, Char> -> @nn:U32 -> WhenOut

two digits decide a time or a date

def when.after2 source · line 1098 · raw

@dd:Dig -> WhenOut

two digits decide a time (HH:) or a date (YYYY-)

def when.read source · line 1106 · raw

@cs:List<&2, Char> -> WhenOut

a datetime token

def word.dash.hit source · line 1110 · raw

@first:Bool -> @+cc:Char -> Bool

a dash after the first character

def word.or source · line 1118 · raw

@aa:Bool -> @bb:Bool -> Bool

either flag

def word.colon source · line 1126 · raw

@cs:List<&2, Char> -> Bool

a colon anywhere in the token

def word.ee.hit source · line 1134 · raw

@+cc:Char -> Bool

e or E: an exponent, so the token is a numeral rather than a datetime

def word.ee source · line 1138 · raw

@cs:List<&2, Char> -> Bool

whether the token holds an exponent marker

def word.as_date source · line 1146 · raw

@date:Bool -> @exp:Bool -> Bool

a datetime scan only when the token is not an exponent numeral

def word.dash source · line 1154 · raw

@cs:List<&2, Char> -> @first:Bool -> Bool

a dash after the first character

def word.spec.nan3 source · line 1162 · raw

@cc:Bool -> Got

a negative nan, or not a special

def word.spec.nan2 source · line 1170 · raw

@bb:Bool -> @cc:Bool -> Got

a signed nan

def word.spec.nan source · line 1178 · raw

@aa:Bool -> @bb:Bool -> @cc:Bool -> Got

nan

def str.eq.step source · line 1186 · raw

@aa:String -> @bb:String -> @same:Bool -> Bool

character-for-character equality. a mismatch drops the rest and stops

def str.eq source · line 1196 · 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 1200 · raw

@cc:Bool -> @+ss:String -> Got

a negative inf, or nan

def word.spec.inf2 source · line 1208 · raw

@bb:Bool -> @cc:Bool -> @+ss:String -> Got

a signed inf, or nan

def word.spec.inf source · line 1216 · raw

@aa:Bool -> @bb:Bool -> @cc:Bool -> @+ss:String -> Got

inf, or nan

def word.spec.f source · line 1224 · raw

@hit:Bool -> @+ss:String -> Got

false, or the rest of the specials

def word.spec.t source · line 1232 · raw

@hit:Bool -> @other:Bool -> @+ss:String -> Got

true, or the rest of the specials

def word.spec source · line 1240 · raw

@+ss:String -> Got

true, false, inf, and nan, including a sign on inf and nan

def word.from.when source · line 1244 · raw

@ww:WhenOut -> Got

a datetime result as a value

def word.body.put.sign source · line 1254 · 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 1262 · 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 1270 · raw

@lead:Bool -> @+cc:Char -> @out:List<&2, Char> -> List<&2, Char>

one character of a numeral spelling

def word.body.go source · line 1278 · 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 1286 · raw

@cs:List<&2, Char> -> String

the spelling of a numeral with the leading sign and underscores removed

def num.start source · line 1290 · raw

Num

a fresh numeral scan

def num.bad source · line 1294 · raw

@_st:Num -> @why:String -> Num

a scan that has failed

def num.sign source · line 1298 · raw

@_st:Num -> @sign:Sign -> Num

set the sign and wait for a digit

def num.digit.ok source · line 1302 · 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 1310 · raw

@st:Num -> @+cc:Char -> @nk:NK -> Num

a decimal digit joined to the numeral

def num.digit source · line 1315 · raw

@st:Num -> @+cc:Char -> @nk:NK -> Num

a decimal digit joined to the numeral

def num.us.go source · line 1319 · 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 1327 · raw

@st:Num -> Num

an underscore between digits

def num.base source · line 1332 · raw

@st:Num -> @base:U32 -> Num

the base prefix after a leading zero

def num.dot.go source · line 1337 · raw

@ok:Bool -> @sign:Sign -> Num

a dot begins the fraction

def num.dot source · line 1345 · raw

@st:Num -> Num

a dot begins the fraction

def num.exp.go source · line 1350 · raw

@ok:Bool -> @sign:Sign -> Num

an exponent marker

def num.exp source · line 1358 · raw

@st:Num -> Num

an exponent marker

def num.sign.of source · line 1363 · raw

@st:Num -> Sign

the sign already chosen

def num.lead.digit source · line 1368 · raw

@digit:Bool -> @st:Num -> @+cc:Char -> Num

a first digit

def num.lead.zero source · line 1376 · raw

@zero:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num

a leading zero, or another digit

def num.lead.minus source · line 1384 · 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 1392 · 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 1400 · raw

@st:Num -> @+cc:Char -> Num

the first character after an optional sign

def num.after.sign.go source · line 1406 · 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 1414 · raw

@st:Num -> @+cc:Char -> Num

the character after a sign

def num.zero.exp2 source · line 1419 · 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 1427 · 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 1435 · 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 1443 · 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 1451 · 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 1459 · 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 1467 · raw

@st:Num -> @+cc:Char -> Num

the character after a lone zero

def num.digs.exp2 source · line 1472 · raw

@ee:Bool -> @st:Num -> @_c:Char -> Num

a capital exponent, or a rejected character

def num.digs.exp source · line 1480 · raw

@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num

an exponent

def num.digs.dot source · line 1488 · raw

@dot:Bool -> @eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num

a dot or an exponent

def num.digs.us source · line 1496 · 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 1504 · 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 1512 · raw

@st:Num -> @+cc:Char -> Num

a decimal digit, an underscore, a dot, or an exponent

def num.based.go source · line 1517 · raw

@us:Bool -> @st:Num -> @+cc:Char -> Num

an underscore, or a digit of the base

def num.based source · line 1525 · raw

@st:Num -> @+cc:Char -> Num

a digit of a prefixed integer, or an underscore

def num.frac.exp2 source · line 1529 · raw

@ee:Bool -> @st:Num -> @_c:Char -> Num

a capital exponent, or a rejected character

def num.frac.exp source · line 1537 · raw

@eee:Bool -> @ee:Bool -> @st:Num -> @+cc:Char -> Num

an exponent in a fraction

def num.frac.us source · line 1545 · 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 1553 · 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 1561 · raw

@st:Num -> @+cc:Char -> Num

a fraction digit, an underscore, or an exponent

def num.exp.sign source · line 1566 · raw

@st:Num -> Num

the exponent sign is part of the spelling; digits follow

def num.expon.digit source · line 1571 · raw

@digit:Bool -> @st:Num -> @+cc:Char -> Num

a digit of the exponent

def num.expon.minus source · line 1579 · raw

@minus:Bool -> @digit:Bool -> @st:Num -> @+cc:Char -> Num

a minus or a digit in an exponent

def num.expon.go source · line 1587 · 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 1595 · raw

@st:Num -> @+cc:Char -> Num

the sign or the first digit of an exponent

def num.edig.us source · line 1599 · raw

@us:Bool -> @st:Num -> @_c:Char -> Num

an underscore in an exponent

def num.edig.go source · line 1607 · raw

@digit:Bool -> @us:Bool -> @st:Num -> @+cc:Char -> Num

an exponent digit or an underscore

def num.edig source · line 1615 · raw

@st:Num -> @+cc:Char -> Num

an exponent digit or an underscore

def num.on source · line 1619 · raw

@nk:NK -> @st:Num -> @+cc:Char -> Num

one character of a numeral

def num.step.go source · line 1641 · raw

@st:Num -> @+cc:Char -> Num

one character of a numeral

def num.step source · line 1646 · raw

@st:Num -> @+cc:Char -> Num

one character of a numeral

def num.go source · line 1650 · raw

@cs:List<&2, Char> -> @st:Num -> Num

the walk over a numeral

def i64.limit source · line 1658 · raw

@sign:Sign -> String

the positive limit is 2^63-1; the negative limit is 2^63

def i64.ord source · line 1666 · raw

@seen:Cmp -> @now:Cmp -> Cmp

the first differing digit stands; a tie takes the new order

def i64.step source · line 1677 · 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 1689 · raw

@+sign:Sign -> @+digits:String -> Bool

whether the integer fits in a signed 64-bit integer

def num.fin.range source · line 1693 · raw

@ok:Bool -> @sign:Sign -> @digits:String -> Got

an integer inside the signed 64-bit range

def num.fin.int source · line 1701 · 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 1709 · raw

@saw:Bool -> @val:Val -> Got

a numeral needs a digit in its last run

def num.signed source · line 1717 · raw

@cs:List<&2, Char> -> Bool

a prefixed integer may not carry a sign

def num.fin.base source · line 1725 · 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 1733 · 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 1755 · 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 1763 · raw

@st:Num -> @cs:List<&2, Char> -> Got

the value of a finished numeral

def word.num source · line 1768 · raw

@+cs:List<&2, Char> -> Got

a numeral token

def word.route.date source · line 1772 · 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 1780 · raw

@gg:Got -> @date:Bool -> @+cs:List<&2, Char> -> Got

a special word, or a numeral

def word.special.minus source · line 1788 · raw

@+cc:Char -> Bool

'-' can start a signed inf or nan

def word.special.plus source · line 1792 · raw

@hit:Bool -> @+cc:Char -> Bool

'+' or '-'

def word.special.n source · line 1800 · raw

@hit:Bool -> @+cc:Char -> Bool

'n', or a sign

def word.special.i source · line 1808 · raw

@hit:Bool -> @+cc:Char -> Bool

'i', or nan, or a sign

def word.special.f source · line 1816 · raw

@hit:Bool -> @+cc:Char -> Bool

'f', or inf, or nan, or a sign

def word.special.t source · line 1824 · raw

@hit:Bool -> @+cc:Char -> Bool

't', or false, or inf, or nan, or a sign

def word.special source · line 1832 · raw

@+cc:Char -> Bool

whether this character can start a special bare word

def word.lead source · line 1836 · raw

@cs:List<&2, Char> -> Bool

the first character, when the word has one

def word.val.num source · line 1844 · raw

@+cs:List<&2, Char> -> Got

a numeral or a datetime. the token cannot be a keyword

def word.val.pick source · line 1848 · 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 1857 · raw

@+cs:List<&2, Char> -> Got

a bare word: a special, a datetime, or a numeral

def err.first.go source · line 1895 · raw

@empty:Bool -> @bad:String -> @why:String -> String

the first error is kept

def err.first source · line 1903 · raw

@+bad:String -> @why:String -> String

the first error is kept

def find.step source · line 1907 · raw

@eq:Bool -> @vv:Val -> @more:(@_:Unit -> Hit) -> Hit

a key found earlier wins

def rows.find source · line 1915 · raw

@rows:List<&2, Val> -> @+name:String -> Hit

the first pair of this name

def get source · line 1925 · raw

@rows:List<&2, Val> -> @+name:String -> Hit

the value written for a key, or Miss

def rows.repl.step source · line 1929 · 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 1937 · raw

@rows:List<&2, Val> -> @+name:String -> @+val:Val -> List<&2, Val>

replace every pair of this name

def heads.or source · line 1947 · raw

@aa:Bool -> @bb:Bool -> Bool

either flag

def heads.by.head source · line 1956 · 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 1960 · raw

@path:String -> String

a table dotted keys defined, as heads records it

def heads.has source · line 1964 · 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 1974 · raw

@hs:List<&2, String> -> @+pp:String -> Bool

whether a table path was defined by a header

def heads.drop.step source · line 1984 · 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 1998 · 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 2008 · 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 2016 · 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 2024 · raw

@empty:Bool -> @pre:String -> @name:String -> String

a dotted path from a prefix and one segment

def tree.pre source · line 2032 · raw

@+pre:String -> @name:String -> String

a dotted path from a prefix and one segment

def look.of source · line 2036 · raw

@vv:Val -> Look

the value a key already holds

def look.step source · line 2048 · raw

@eq:Bool -> @vv:Val -> @more:(@_:Unit -> Look) -> Look

the matching pair, or the rest of the table

def rows.look source · line 2056 · raw

@rows:List<&2, Val> -> @+name:String -> Look

what a key in this table refers to

def look.last.one source · line 2066 · 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 2074 · 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 2084 · 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 2094 · 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 2102 · 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 2118 · 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 2136 · 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 2160 · 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 2172 · 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 2195 · 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 2207 · 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 2225 · 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 2242 · raw

@name:String -> @tw:Tw -> End

the key at the end of the path

def tree.sub.aots source · line 2247 · 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 2266 · 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 2274 · raw

@job:Job -> Bool

a segment of a dotted key, which defines tables as it goes

def tree.sub.head.go source · line 2282 · 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 2303 · 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 2325 · 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 2344 · 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 2372 · 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 2391 · raw

@name:String -> @tw:Tw -> @mark:Bool -> Tw

descend into one key

def path.len source · line 2396 · raw

@xs:List<&2, String> -> @nn:U32 -> U32

how many segments are already the current table

def path.dec.z source · line 2404 · raw

@zz:Bool -> @skip:U32 -> U32

one fewer prefix segment, staying at zero

def path.dec source · line 2412 · raw

@+skip:U32 -> U32

one fewer prefix segment, staying at zero

def tree.walk.none source · line 2416 · raw

@tw:Tw -> End

an empty path records an error

def tree.walk source · line 2421 · 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 2433 · raw

@+cc:Char -> Bool

space or tab

def ch.space source · line 2437 · raw

@+cc:Char -> Bool

the space character itself, U+0020, the only one a datetime may hold

def ch.nl source · line 2441 · raw

@+cc:Char -> Bool

line feed or carriage return

def ch.ctl source · line 2445 · raw

@+cc:Char -> Bool

a control: U+0000 to U+001F, or U+007F

def ch.delim source · line 2449 · raw

@+cc:Char -> Bool

a character that ends a bare value

def ch.skip source · line 2454 · raw

@+cc:Char -> Bool

whitespace that a bare value swallows

def q.char source · line 2458 · raw

@kk:QKind -> Char

the quote character of a string kind

def q.multi source · line 2468 · raw

@kk:QKind -> Bool

a multiline string

def q.basic source · line 2478 · raw

@kk:QKind -> Bool

a basic string, which has escapes

def q.as.multi source · line 2488 · raw

@kk:QKind -> QKind

the multiline kind of a one-line kind

def date.mode source · line 2496 · raw

@pp:Char -> Bool

a pattern character that stands for a digit

def date.eq.go source · line 2500 · raw

@ok:Bool -> @more:(@_:Unit -> Bool) -> Bool

whether the rest of the shape matches

def date.step source · line 2508 · raw

@mode:Bool -> @digit:Bool -> @same:Bool -> @more:(@_:Unit -> Bool) -> Bool

one character of a date shape

def date.eq.nil source · line 2516 · raw

@pat:List<&2, Char> -> Bool

both lists ended together

def date.eq source · line 2524 · raw

@cs:List<&2, Char> -> @pat:List<&2, Char> -> Bool

YYYY-MM-DD, with D standing for a digit

def date.shaped source · line 2537 · raw

@buf:List<&2, Char> -> Bool

the buffer is a calendar date

def buf.str.go source · line 2541 · 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 2549 · raw

@buf:List<&2, Char> -> String

the buffer, in order

def span.str source · line 2553 · raw

@src:String -> @+nn:U32 -> @zz:Bool -> String

the first n characters of a source span

def span.rev source · line 2563 · 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 2573 · raw

@src:String -> Unit

the unread suffix of a span that will not be stored

def path.cat source · line 2581 · 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 2585 · raw

@nl:Bool -> @multi:Bool -> Bool

a multiline string keeps a newline

def str.bad.tab source · line 2593 · raw

@tab:Bool -> @nl:Bool -> @multi:Bool -> Bool

tab is kept

def str.bad.go source · line 2601 · raw

@ctrl:Bool -> @tab:Bool -> @nl:Bool -> @multi:Bool -> Bool

a raw control is rejected

def str.bad source · line 2609 · 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 2614 · raw

@st:St -> @why:String -> St

the scanner has failed

def st.lex source · line 2621 · raw

@st:St -> @lex:Lex -> St

replace the lex state

def st.hold source · line 2628 · raw

@st:St -> @+lex:Lex -> @cc:Char -> St

hold one character and set the lex state

def st.push source · line 2635 · raw

@st:St -> @cc:Char -> @lex:Lex -> St

append one character

def seg.push source · line 2642 · raw

@st:St -> @lex:Lex -> St

the segment in the buffer joins the key, and the buffer is cleared

def take.root source · line 2649 · 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 2664 · 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 2683 · 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 2713 · raw

@st:St -> @val:Val -> St

place a finished value

def bare.hold.on source · line 2720 · raw

@st:St -> @cc:Char -> St

hold the delimiter when the following state must see it

def bare.line.lex source · line 2728 · 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 2736 · raw

@st:St -> St

a consumed newline returns to the top level after a root value

def bare.line source · line 2743 · raw

@st:St -> @nl:Bool -> St

a consumed newline returns to the top level after a root value

def bare.hold source · line 2751 · raw

@st:St -> @cc:Char -> @hold:Bool -> St

hold the delimiter when the following state must see it

def bare.got source · line 2759 · raw

@gg:Got -> @st:St -> @cc:Char -> @hold:Bool -> St

a bare word has been classified

def bare.finish source · line 2767 · 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 2775 · 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 2781 · 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 2804 · 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 2810 · raw

@empty:Bool -> @st:St -> @segs:List<&2, String> -> St

the header key is ready

def head.use source · line 2818 · raw

@st:St -> St

the segment was pushed

def head.fin.buf source · line 2826 · raw

@empty:Bool -> @st:St -> St

the buffer is the last segment when it holds one

def head.fin source · line 2834 · raw

@st:St -> St

push a trailing segment, then open the header

def arr.top source · line 2842 · 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 2863 · raw

@st:St -> St

close an array and place it

def inl.seal source · line 2870 · 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 2880 · 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 2901 · raw

@st:St -> St

close an inline table and place it

def inl.open source · line 2907 · raw

@stack:List<&2, Ctx> -> Bool

the innermost frame is an inline table

def str.fin source · line 2915 · raw

@st:St -> St

a string is finished

def mq.put source · line 2922 · 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 2930 · raw

@+uu:U32 -> Bool

a code point may be written as a character

def uni.finish.on source · line 2935 · raw

@st:St -> @uu:U32 -> @back:Lex -> St

a finished unicode escape written into the buffer

def uni.finish source · line 2942 · raw

@ok:Bool -> @st:St -> @uu:U32 -> @back:Lex -> St

a finished unicode escape

def uni.next.more source · line 2950 · raw

@st:St -> @uu:U32 -> @left:U32 -> St

another hex digit is still required

def uni.next source · line 2957 · 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 2965 · 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 2973 · raw

@st:St -> @+cc:Char -> @back:Lex -> St

one hex digit of a unicode escape

def esc.uu source · line 2981 · raw

@uu:Bool -> Esc

a long unicode escape, or an unknown escape

def esc.u source · line 2989 · raw

@uuu:Bool -> @uu:Bool -> Esc

a unicode escape

def esc.r source · line 2997 · raw

@rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc

carriage return or a unicode escape

def esc.f source · line 3005 · raw

@ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc

form feed or the rest

def esc.n source · line 3013 · raw

@nn:Bool -> @ff:Bool -> @rr:Bool -> @uuu:Bool -> @uu:Bool -> Esc

newline or the rest

def esc.t source · line 3021 · 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 3029 · 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 3037 · 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 3045 · 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 3053 · 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 3061 · 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 3081 · raw

@+cc:Char -> Esc

classify one escaped character

def esc.uni.lex source · line 3087 · raw

@back:Lex -> Lex

the lex state that reads the hex digits of an escape

def esc.uni source · line 3097 · raw

@st:St -> @back:Lex -> @nn:U32 -> St

a unicode escape starts with no digits seen

def esc.fold.bit source · line 3104 · raw

@saw:Bool -> U32

1 once a newline has been seen

def esc.fold.on source · line 3112 · raw

@st:St -> @saw:Bool -> St

a line-ending backslash skips following whitespace

def esc.fold.kind source · line 3119 · 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 3127 · raw

@st:St -> @saw:Bool -> St

a line-ending backslash is only part of a multiline string

def esc.fold.use source · line 3134 · raw

@back:Lex -> @st:St -> @saw:Bool -> St

a line-ending backslash is only part of a string

def esc.use source · line 3142 · raw

@ee:Esc -> @st:St -> @back:Lex -> St

apply one escape and return to the string

def com.enter source · line 3154 · raw

@st:St -> @back:Lex -> St

the lex state a comment returns to

def lex.top.bare source · line 3161 · raw

@bare:Bool -> @st:St -> @cc:Char -> St

a bare key, or a rejected character

def lex.bracket source · line 3169 · raw

@st:St -> St

a header starts with a clear key

def lex.qkey source · line 3176 · raw

@st:St -> @kind:QKind -> @lex:Lex -> St

a quoted key starts with an empty buffer

def lex.top.lit source · line 3183 · raw

@lit:Bool -> @bare:Bool -> @st:St -> @cc:Char -> St

a literal key or a bare key

def lex.top.q source · line 3191 · 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 3199 · 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 3207 · 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 3215 · 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 3223 · 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 3231 · raw

@st:St -> @+cc:Char -> St

top level: a key, a header, a comment, or whitespace

def lex.key.nl source · line 3236 · raw

@nl:Bool -> @st:St -> @_c:Char -> St

a newline before equals is rejected

def lex.key.end.go source · line 3244 · raw

@empty:Bool -> @st:St -> @lex:Lex -> St

an empty segment is rejected

def lex.key.end source · line 3252 · raw

@st:St -> @next:Lex -> St

end a nonempty segment

def lex.key.hash source · line 3260 · 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 3268 · raw

@eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @+cc:Char -> St

an equals ends the key

def lex.key.dot source · line 3276 · 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 3284 · 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 3292 · 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 3300 · raw

@st:St -> @+cc:Char -> St

inside a bare key segment

def lex.after.nl source · line 3305 · raw

@nl:Bool -> @st:St -> @_c:Char -> St

a newline before equals is rejected

def lex.after.hash source · line 3313 · raw

@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

a comment waits for equals

def lex.after.eq source · line 3321 · raw

@eq:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

equals starts the value

def lex.after.dot source · line 3329 · 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 3337 · 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 3345 · raw

@st:St -> @+cc:Char -> St

after a key segment, before equals or a dot

def lex.val.nl3 source · line 3350 · raw

@inside:Bool -> @st:St -> St

a value starts on the line of its key

def lex.val.nl2 source · line 3358 · raw

@st:St -> @_c:Char -> St

a newline before a value is rejected

def lex.array source · line 3366 · raw

@st:St -> St

an array starts a frame and waits for a value

def lex.inline source · line 3373 · raw

@st:St -> St

an inline table starts a frame and waits for a key

def lex.val.inl source · line 3380 · raw

@inl:Bool -> @st:St -> @cc:Char -> St

an inline table, or a bare value

def lex.val.br source · line 3388 · raw

@br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St

an array, or another value

def lex.val.lit source · line 3396 · raw

@lit:Bool -> @br:Bool -> @inl:Bool -> @st:St -> @cc:Char -> St

a literal string, or another value

def lex.val.q source · line 3404 · 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 3412 · 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 3420 · 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 3428 · 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 3436 · raw

@st:St -> @+cc:Char -> St

the start of a value

def lex.q.go source · line 3441 · 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 3449 · raw

@st:St -> @+cc:Char -> St

the first quote has been seen

def lex.multi source · line 3457 · raw

@st:St -> @kind:QKind -> St

a multiline string, about to trim one opening newline

def lex.q2.go source · line 3464 · 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 3472 · raw

@st:St -> @+cc:Char -> St

two quotes have been seen

def lex.trim.nl source · line 3480 · 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 3488 · 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 3496 · raw

@st:St -> @+cc:Char -> St

trim one opening newline of a multiline string

def lex.trim2.go source · line 3500 · raw

@lf:Bool -> @st:St -> @cc:Char -> St

the line feed of a CRLF opening newline

def lex.trim2 source · line 3508 · raw

@st:St -> @+cc:Char -> St

the line feed of a CRLF opening newline

def lex.str.char.go source · line 3512 · raw

@bad:Bool -> @st:St -> @cc:Char -> St

a forbidden control, or one character of the string

def lex.str.char source · line 3520 · raw

@multi:Bool -> @st:St -> @+cc:Char -> St

a raw character, rejected when it is a forbidden control

def lex.str.bs source · line 3524 · raw

@bs:Bool -> @multi:Bool -> @st:St -> @cc:Char -> @_kind:QKind -> St

an escape, or a plain character

def lex.str.esc source · line 3532 · 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 3540 · raw

@st:St -> @nn:U32 -> St

count closing quotes of a multiline string

def lex.str.quote source · line 3547 · 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 3555 · 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 3563 · raw

@st:St -> @+cc:Char -> St

inside a string

def lex.mq.shut source · line 3571 · 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 3578 · raw

@one:Bool -> @st:St -> St

the second quote waits; the third is a closing delimiter

def lex.mq.back source · line 3586 · 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 3593 · 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 3601 · raw

@st:St -> @+cc:Char -> St

one character while closing a multiline string

def lex.mq.more source · line 3609 · raw

@st:St -> @cc:Char -> St

a quote after the closing delimiter: the delimiter moves one quote on

def lex.mq.fin source · line 3616 · raw

@st:St -> @cc:Char -> St

the string ends before this character, which the next state reads

def lex.mq.room source · line 3620 · 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 3628 · 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 3636 · raw

@st:St -> @+cc:Char -> St

one character after a multiline string's closing delimiter

def lex.esc source · line 3644 · raw

@st:St -> @+cc:Char -> St

one escaped character

def lex.fold.saw source · line 3648 · raw

@st:St -> St

remember that a newline was seen

def lex.fold.end.go source · line 3655 · raw

@saw:Bool -> @st:St -> @cc:Char -> St

a character before the newline is rejected

def lex.fold.end source · line 3663 · raw

@st:St -> @cc:Char -> St

the next character ends the fold only after a newline

def lex.fold.nl source · line 3671 · 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 3679 · raw

@sp:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

more whitespace, or the next character of the string

def lex.fold source · line 3687 · raw

@st:St -> @+cc:Char -> St

whitespace after a line-ending backslash

def lex.bare.date.go source · line 3691 · 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 3699 · raw

@st:St -> @cc:Char -> St

a date may continue after one space

def lex.bare.hold source · line 3707 · 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 3711 · 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 3718 · raw

@sp:Bool -> @st:St -> @cc:Char -> St

a space may be the space inside a datetime

def lex.bare.go source · line 3726 · raw

@delim:Bool -> @sp:Bool -> @st:St -> @cc:Char -> St

a delimiter ends the token

def lex.bare source · line 3734 · raw

@st:St -> @+cc:Char -> St

a bare value

def lex.date.digit source · line 3738 · raw

@st:St -> @cc:Char -> St

the space and the digit belong to the datetime

def lex.date.go source · line 3745 · raw

@digit:Bool -> @st:St -> @cc:Char -> St

the character after the space of a possible datetime

def lex.date source · line 3753 · raw

@st:St -> @+cc:Char -> St

the character after the space of a possible datetime

def lex.com.nl source · line 3757 · raw

@st:St -> @cc:Char -> St

the newline is read again in the state that was waiting

def lex.com.tab source · line 3764 · raw

@tab:Bool -> @st:St -> St

tab is the one control a comment may hold

def lex.com.ctl source · line 3772 · raw

@ctl:Bool -> @tab:Bool -> @st:St -> St

any other character is part of the comment

def lex.com.go source · line 3780 · 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 3788 · raw

@st:St -> @+cc:Char -> St

a comment runs to the end of the line

def lex.head.arr source · line 3792 · raw

@st:St -> St

the header is an array of tables

def lex.head.br2 source · line 3799 · raw

@once:Bool -> @st:St -> St

one extra bracket

def lex.head.br.go source · line 3807 · raw

@fresh:Bool -> @once:Bool -> @st:St -> St

the second bracket is only legal at the start

def lex.head.br source · line 3815 · raw

@st:St -> St

[[ opens an array of tables when the key has not started

def lex.head.ch.go source · line 3824 · raw

@gap:Bool -> @st:St -> @cc:Char -> St

between segments a dot is required

def lex.head.ch source · line 3832 · 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 3842 · 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 3850 · raw

@st:St -> St

whitespace ends a segment when one is open

def lex.head.dot3 source · line 3858 · raw

@empty:Bool -> @st:St -> St

a dot with no segment is rejected

def lex.head.dot2 source · line 3866 · raw

@st:St -> St

a dot ends the open segment

def lex.head.close2 source · line 3874 · raw

@arr:Bool -> @st:St -> St

an array of tables still needs one ]

def lex.head.close.go source · line 3882 · raw

@empty:Bool -> @arr:Bool -> @st:St -> St

push the last segment when the buffer holds one

def lex.head.close source · line 3890 · raw

@st:St -> St

] closes, or waits for the second ] of an array of tables

def lex.head.hash source · line 3898 · raw

@hash:Bool -> @st:St -> St

a comment in a header

def lex.head.quote.go source · line 3907 · 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 3915 · raw

@st:St -> @kind:QKind -> St

a quoted header segment, right after the bracket

def lex.head.lit source · line 3924 · raw

@lit:Bool -> @hash:Bool -> @st:St -> St

a literal header segment or a comment

def lex.head.q source · line 3932 · 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 3940 · 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 3948 · 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 3956 · 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 3964 · 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 3972 · 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 3991 · raw

@st:St -> @+cc:Char -> St

inside a header

def lex.hgap.end source · line 3997 · raw

@end:Bool -> @hash:Bool -> @st:St -> St

the end, or a comment

def lex.hgap.dot source · line 4005 · raw

@dot:Bool -> @end:Bool -> @hash:Bool -> @st:St -> St

a dot starts the next segment

def lex.hgap source · line 4013 · 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 4021 · raw

@st:St -> @+cc:Char -> St

between header segments

def lex.hdot.lit source · line 4025 · raw

@lit:Bool -> @st:St -> @_c:Char -> St

a literal segment, or a rejected character

def lex.hdot.q source · line 4033 · raw

@qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St

a quoted segment

def lex.hdot.bare source · line 4041 · raw

@bare:Bool -> @qq:Bool -> @lit:Bool -> @st:St -> @cc:Char -> St

a bare segment or a quoted one

def lex.hdot source · line 4049 · 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 4057 · raw

@st:St -> @+cc:Char -> St

after a dot, a segment must start

def lex.kq.char.go source · line 4061 · 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 4069 · raw

@st:St -> @+cc:Char -> @stay:Lex -> St

one character of a quoted key

def lex.kq.nl source · line 4073 · raw

@nl:Bool -> @st:St -> @+cc:Char -> @stay:Lex -> St

a newline in a key is rejected

def lex.esc.lex source · line 4081 · raw

@stay:Lex -> Lex

the escape state for a quoted key

def lex.kesc source · line 4089 · raw

@st:St -> @+stay:Lex -> St

the escape returns to the quoted key

def lex.kq.esc source · line 4096 · raw

@basic:Bool -> @st:St -> @stay:Lex -> St

only a basic key treats the backslash as an escape

def lex.kq.bs source · line 4104 · 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 4112 · raw

@st:St -> @next:Lex -> St

a quoted segment may be empty

def lex.kq.go source · line 4116 · 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 4124 · 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 4132 · raw

@end:Bool -> @st:St -> St

the second ] of an array of tables

def lex.head.r source · line 4140 · raw

@st:St -> @+cc:Char -> St

the second ] of an array of tables

def lex.arr.end source · line 4144 · raw

@end:Bool -> @st:St -> @cc:Char -> St

] closes; anything else is a value

def lex.arr.hash source · line 4152 · raw

@hash:Bool -> @end:Bool -> @st:St -> @cc:Char -> St

a comment, the end, or a value

def lex.arr.nl source · line 4160 · 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 4168 · 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 4176 · raw

@st:St -> @+cc:Char -> St

an array waits for a value or ]

def lex.arrc.end source · line 4180 · raw

@end:Bool -> @st:St -> St

] closes the array

def lex.arrc.comma source · line 4188 · raw

@comma:Bool -> @end:Bool -> @st:St -> St

a comma waits for another value

def lex.arrc.hash source · line 4196 · 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 4204 · raw

@nl:Bool -> @hash:Bool -> @comma:Bool -> @end:Bool -> @st:St -> @cc:Char -> St

a newline is whitespace

def lex.arrc.go source · line 4212 · 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 4220 · raw

@st:St -> @+cc:Char -> St

after an array value: a comma, ], or whitespace

def lex.key.clear source · line 4225 · raw

@st:St -> St

a new key starts with an empty segment list

def lex.key.bare source · line 4232 · raw

@ok:Bool -> @st:St -> @cc:Char -> St

a bare character opens the key

def lex.key.lit source · line 4240 · raw

@lit:Bool -> @st:St -> @+cc:Char -> St

a literal quote or a bare character opens the key

def lex.key.q source · line 4248 · raw

@qq:Bool -> @st:St -> @+cc:Char -> St

a quote or a bare character opens the key

def lex.key.start source · line 4256 · raw

@st:St -> @+cc:Char -> St

the first character of a key inside an inline table

def lex.inl.nl source · line 4260 · raw

@nl:Bool -> @st:St -> @cc:Char -> St

a newline is rejected; anything else is a key

def lex.inl.end source · line 4268 · raw

@end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

} closes an empty inline table

def lex.inl.hash source · line 4276 · 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 4284 · 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 4292 · raw

@st:St -> @+cc:Char -> St

an inline table waits for a key or }

def lex.inlk.hash source · line 4296 · raw

@hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

a comment or a key

def lex.inlk.go source · line 4304 · raw

@sp:Bool -> @hash:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

whitespace or a key

def lex.inlk source · line 4312 · raw

@st:St -> @+cc:Char -> St

after a comma, a key is required

def lex.inlc.nl source · line 4316 · raw

@nl:Bool -> @st:St -> St

a newline is rejected

def lex.inlc.end source · line 4324 · raw

@end:Bool -> @nl:Bool -> @st:St -> @_c:Char -> St

} closes the inline table

def lex.inlc.comma source · line 4332 · raw

@comma:Bool -> @end:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

a comma requires another key

def lex.inlc.hash source · line 4340 · 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 4348 · 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 4356 · raw

@st:St -> @+cc:Char -> St

after an inline value: a comma or }

def lex.sink source · line 4361 · raw

@st:St -> @_c:Char -> St

the rest of a failed document is ignored

def lex.line.nl source · line 4365 · raw

@nl:Bool -> @st:St -> St

anything else on the same line is another expression

def lex.line.hash source · line 4373 · raw

@hash:Bool -> @nl:Bool -> @st:St -> @_c:Char -> St

a comment may follow an expression

def lex.line.go source · line 4381 · 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 4389 · 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 4393 · raw

@nl:Bool -> @st:St -> St

a newline in a dotted key is rejected

def lex.kdot.dot source · line 4401 · raw

@dot:Bool -> @nl:Bool -> @st:St -> St

a second dot is an empty segment

def lex.kdot.bare source · line 4409 · raw

@bare:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @cc:Char -> St

a bare character starts the segment

def lex.kdot.lit source · line 4417 · raw

@lit:Bool -> @dot:Bool -> @nl:Bool -> @st:St -> @+cc:Char -> St

a literal quote starts the segment

def lex.kdot.q source · line 4425 · 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 4433 · 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 4441 · raw

@st:St -> @+cc:Char -> St

after a dot, whitespace and then a segment

def lex.hq source · line 4446 · raw

@st:St -> @+cc:Char -> St

a quoted header segment

def read.on source · line 4450 · raw

@lex:Lex -> @st:St -> @cc:Char -> St

one character, dispatched on the lex state

def read.on.st source · line 4524 · raw

@st:St -> @cc:Char -> St

read the lex state and step

def read.step.bom source · line 4531 · raw

@bom:Bool -> @st:St -> @cc:Char -> St

one character, after a leading mark has been decided

def read.step.lead source · line 4539 · raw

@lead:Bool -> @st:St -> @+cc:Char -> St

the first character may be a byte-order mark

def read.step source · line 4547 · raw

@st:St -> @+cc:Char -> St

one character of the document

def read.once.hold source · line 4554 · raw

@hold:Hold -> @st:St -> St

a held character is read once

def read.once2 source · line 4562 · raw

@st:St -> St

a held character is read once

def read.once source · line 4569 · 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 4573 · 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 4587 · raw

@st:St -> St

a bare token still open at the end is closed

def rows.seal.fin source · line 4594 · 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 4602 · 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 4627 · raw

@rows:List<&2, Val> -> List<&2, Val>

insertion order of a table built newest-first

def read.fin.stack source · line 4631 · 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 4639 · raw

@st:St -> Doc

the document from a finished state

def read.fin.unclosed source · line 4645 · raw

@st:St -> Doc

an unfinished document keeps the first error

def read.fin.end source · line 4651 · raw

@lex:Lex -> Bool

a comment may end a document only where the line already could

def read.fin.com source · line 4663 · 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 4671 · 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 4678 · raw

@st:St -> Doc

any other state is unfinished

def read.fin.ok source · line 4682 · raw

@lex:Lex -> @st:St -> Doc

the states that may end a document

def read.fin2 source · line 4696 · raw

@st:St -> Doc

the document once the last token has been closed

def read.fin source · line 4703 · raw

@st:St -> Doc

the document at the end of the text

def read.fast.st source · line 4707 · 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 4726 · 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 4746 · 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 4766 · 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 4792 · 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 4816 · 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 4841 · 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 4865 · 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 4892 · 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 4917 · 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 4942 · 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 4967 · 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 4993 · 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 5020 · 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 5048 · 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 5109 · 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 5135 · 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 5162 · raw

@st:St -> @+cc:Char -> St

one source character

def eat.fin source · line 5182 · 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 5200 · 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 5218 · 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 5237 · 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 5264 · 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 5291 · 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 5317 · 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 5344 · 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 5365 · raw

@_back:Lex -> @mode:Mode -> Mode

the opening quote's back state is not kept on the span

def doc.drop source · line 5369 · raw

@_tail:String -> @mode:Mode -> Mode

a suffix the span does not keep

def doc.open.buf source · line 5373 · 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 5400 · 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 5428 · 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 5455 · 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 5482 · 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 5510 · 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 5532 · 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 5558 · 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 5582 · 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 5607 · 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 5633 · raw

@st:St -> Mode

a quote may have opened a string

def doc.scan.cr source · line 5640 · raw

@cr:Bool -> @st:St -> @cc:Char -> Mode

a carriage return must be followed by a line feed

def doc.scan.sq source · line 5648 · raw

@sq:Bool -> @cr:Bool -> @st:St -> @cc:Char -> Mode

an apostrophe may open a literal string

def doc.scan.q source · line 5656 · 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 5664 · raw

@st:St -> @+cc:Char -> Mode

one source character outside a plain string

def doc.cr source · line 5669 · 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 5677 · 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 5705 · raw

St

a scanner at the start of a document

def span.esc source · line 5720 · raw

@+uu:U32 -> Bool

quote, backslash, or a control. those still take the escaping writer

def span.quote.push source · line 5725 · 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 5735 · raw

@acc:SqAcc -> Sq

the reversed body, or a stop, as the quoting result

def span.quote.go source · line 5743 · 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 5754 · 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 5762 · raw

@+src:String -> @+nn:U32 -> String

a plain string span, quoted without rebuilding an escaped copy

def render.bool source · line 5766 · raw

@bit:Bool -> String

true or false

def render.atom source · line 5774 · raw

@vv:Val -> String

a scalar value

def render.suf.last source · line 5792 · raw

@last:Bool -> @gap:String -> String

a separator that is omitted after the last item

def render.suf source · line 5800 · raw

@+gap:String -> @trail:Bool -> @last:Bool -> String

a separator. trail keeps the separator after the last item

def render.go source · line 5808 · 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 5841 · 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 5854 · raw

@_rows:List<&2, Val> -> @text:String -> String

the rows are already closed over by the nested rendering

def render.rest source · line 5858 · 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 5862 · 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 5880 · 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 5896 · 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 5914 · 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 5929 · 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 5968 · raw

@+vs:List<&2, Val> -> @+gap:String -> @+trail:Bool -> String

keys first, then tables and arrays of tables

def string source · line 5972 · raw

@vv:Val -> String

the text of a string value

def digits source · line 5982 · raw

@vv:Val -> String

the digits of an integer value

def flag source · line 5990 · raw

@vv:Val -> Bool

the bit of a boolean value

def at.rows source · line 5998 · raw

@vv:Val -> List<&2, Val>

the rows of a table value

def at.rows_of source · line 6010 · raw

@hh:Hit -> List<&2, Val>

the rows of a hit, when it is a table

def at.step source · line 6018 · raw

@rest:List<&2, String> -> @hit:Hit -> Hit

the rest of a path after the first key

def at source · line 6026 · raw

@rows:List<&2, Val> -> @path:List<&2, String> -> Hit

the value at a dotted path

def root source · line 6034 · raw

@doc:Doc -> List<&2, Val>

the root table

def bad source · line 6039 · raw

@doc:Doc -> String

the first error, or "" when the document is well formed

def str source · line 6044 · raw

@text:String -> Val

a string value

def integer source · line 6048 · raw

@sign:Sign -> @text:String -> Val

an integer value

def float source · line 6052 · raw

@sign:Sign -> @text:String -> Val

a float value

def boolean source · line 6056 · raw

@bit:Bool -> Val

a boolean value

def array source · line 6060 · raw

@items:List<&2, Val> -> Val

an array value

def inline source · line 6064 · raw

@rows:List<&2, Val> -> Val

an inline table

def table source · line 6068 · raw

@path:String -> @rows:List<&2, Val> -> Val

a table

def pair source · line 6072 · raw

@name:String -> @val:Val -> Val

a key and a value

def render source · line 6076 · raw

@doc:Doc -> String

a document written back as TOML

def parse source · line 6081 · raw

@text:String -> Doc

a document read from TOML text

def wf.then source · line 6110 · raw

@ok:Bool -> @more:(@_:Unit -> Bool) -> Bool

the rest when this part holds, and False otherwise

def wf.char source · line 6118 · raw

@+cc:Char -> Bool

a Unicode scalar value: no surrogate, and nothing past U+10FFFF

def wf.text source · line 6122 · raw

@ss:String -> Bool

every character of a string or a key is a Unicode scalar value

def wf.span source · line 6130 · 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 6140 · raw

@ss:String -> Bool

every character is an ASCII digit

def wf.dec.lead source · line 6148 · 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 6156 · raw

@ss:String -> Bool

decimal digits with no leading zero, except 0 itself

def wf.int source · line 6164 · raw

@+sign:Sign -> @+digits:String -> Bool

an integer: decimal digits within signed 64 bits

def wf.flo.is_e source · line 6168 · raw

@+cc:Char -> Bool

e or E

def wf.flo.tail source · line 6172 · raw

@+cc:Char -> Fl

after the integer part: a fraction or an exponent

def wf.flo.step source · line 6176 · raw

@st:Fl -> @+cc:Char -> Fl

one character of a float's spelling

def wf.flo.go source · line 6199 · raw

@cs:List<&2, Char> -> @st:Fl -> Fl

a float's spelling read from the given state

def wf.flo.end source · line 6207 · raw

@st:Fl -> Bool

a spelling ends after a fraction's digit or an exponent's digit

def wf.flo source · line 6217 · 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 6222 · 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 6227 · raw

@cc:Clock -> Bool

a time of day: hour, minute and second in range, and a fraction of digits

def wf.zone source · line 6232 · raw

@zz:Zone -> Bool

a zone offset in range

def wf.when source · line 6240 · raw

@ww:When -> Bool

a datetime whose fields are in range

def wf.atom source · line 6253 · 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 6271 · raw

@hit:Hit -> Bool

a name no later pair of the table has

def wf.key source · line 6279 · 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 6283 · 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 6292 · 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 6307 · 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 6315 · 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 6325 · 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 6333 · raw

@vs:List<&2, Val> -> @+at:WfAt -> Bool

a list of values, well-formed where it sits

def wf source · line 6368 · 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