Table of Contents

TomlTokenType Enum

Definition

Namespace
Bodu.Text.Toml
Assembly
Bodu.Text.Toml.dll
Package
Bodu.Text.Toml 1.0.0
Source
TomlTokenType.cs

Identifies the kind of token a forward-only TOML reader is positioned on.

public enum TomlTokenType
Extension Methods

Fields

None = 0

No token; the reader is positioned before the first token or after the last.

StartTable = 1

The start of a table in the normalized stream (a header-defined table, a dotted-key table, or an inline table).

EndTable = 2

The end of a table in the normalized stream.

StartArray = 3

The start of an array, or - in the normalized stream - of an array-of-tables surfaced as an array whose elements are tables.

EndArray = 4

The end of an array, or - in the normalized stream - of an array-of-tables surfaced as an array whose elements are tables.

PropertyName = 5

A key naming the value that follows, in the normalized stream.

String = 6

A string value.

Integer = 7

A 64-bit signed integer value.

Float = 8

An IEEE 754 binary64 floating-point value.

Boolean = 9

A Boolean value.

OffsetDateTime = 10

An RFC 3339 date-time that carries an explicit time offset from UTC.

LocalDateTime = 11

A date-time without any offset or time-zone relation.

LocalDate = 12

A calendar date without any time-of-day, offset, or time-zone relation.

LocalTime = 13

A time of day without any date, offset, or time-zone relation.

TableHeader = 14

A [table] header in the source-order stream, emitted before the header's Key segments.

ArrayTableHeader = 15

An [[array-of-tables]] header in the source-order stream, emitted before the header's Key segments.

Key = 16

One segment of a dotted key in the source-order stream, in a header or in a key/value pair.

Comment = 17

A comment in the source-order stream, from after the # to the end of the line.

StartInlineTable = 18

The start of an inline table value ({) in the source-order stream.

EndInlineTable = 19

The end of an inline table value (}) in the source-order stream.

Remarks

The vocabulary serves the library's two readers. Utf8TomlReader follows the document's surface syntax in source order: a header surfaces as TableHeader or ArrayTableHeader followed by one Key per dotted segment, a key/value pair as its Key segments followed by the value's tokens, an inline table as StartInlineTable / EndInlineTable, and comments as Comment tokens.

TomlDocumentReader projects the parsed document onto a single, normalized, nested token stream. TOML expresses table structure in several different ways - out-of-line [table] and [[array-of-tables]] headers, dotted keys, and inline { … } tables - yet all of them describe the same logical shape. The normalized stream collapses these forms so that a caller sees a uniform sequence of StartTable / EndTable and StartArray / EndArray boundaries with intervening PropertyName and scalar tokens, regardless of how the source spelled the structure; an array-of-tables is surfaced as a StartArray whose elements are each a StartTable.

The scalar members are shared by both readers; the header, key, comment, and inline-table members appear only in the source-order stream, and the table and property-name members only in the normalized stream.

Applies to

ProductVersions
.NET8, 10