TomlToken Struct

Represents a lexical token produced by TomlLexer.

public readonly struct TomlToken

Constructors

NameDescription
TomlToken(TokenKind, TomlTextPosition, TomlTextPosition, string?, ulong)Initializes a new instance of the TomlToken struct.

TomlToken(TokenKind, TomlTextPosition, TomlTextPosition, string?, ulong)

TomlToken.cs

Initializes a new instance of the TomlToken struct.

public TomlToken(TokenKind kind, TomlTextPosition start, TomlTextPosition end, string? stringValue = null, ulong data = 0UL)

Parameters

kind TokenKind
The token kind.
start TomlTextPosition
The start position.
end TomlTextPosition
The end position.
stringValue string?
Optional decoded string value.
data ulong
Optional scalar payload.

Properties

NameDescription
DataGets the optional scalar payload for tokens that carry a non-string value.
EndGets the end position of this token.
KindGets the token kind.
LengthGets the token length (inclusive).
StartGets the start position of this token.
StringValueGets the optional decoded string value for tokens that carry a string payload.

Gets the optional scalar payload for tokens that carry a non-string value.

public ulong Data { get; }

Property value

ulong

Gets the end position of this token.

public TomlTextPosition End { get; }

Property value

TomlTextPosition

Gets the token kind.

public TokenKind Kind { get; }

Property value

TokenKind

Gets the token length (inclusive).

public int Length { get; }

Property value

int

Gets the start position of this token.

public TomlTextPosition Start { get; }

Property value

TomlTextPosition

StringValue

TomlToken.cs

Gets the optional decoded string value for tokens that carry a string payload.

public string? StringValue { get; }

Property value

string?

Methods

NameDescription
ToString()Returns the fully qualified type name of this instance.

ToString()

TomlToken.cs

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string The fully qualified type name.