TomlKeySyntax Class

A key, such as name, "quoted key", or the dotted key server.port.

public sealed class TomlKeySyntax : TomlSyntaxNode

Remarks

The parts of a dotted key and the dots between them are the tokens of one list, so the key keeps the whitespace around each dot exactly as it was written.

Inheritance
TomlSyntaxNode TomlKeySyntax

Properties

NameDescription
IsDottedGets a value indicating whether the key has more than one part.
NamesGets the name of each part of the key, with quotes removed and escape sequences resolved.
PartsGets the parts of the key, without the dots between them.
TokensGets the parts of the key and the dots between them.

Gets a value indicating whether the key has more than one part.

public bool IsDotted { get; }

Property value

bool

Gets the name of each part of the key, with quotes removed and escape sequences resolved.

public IReadOnlyList<string> Names { get; }

Property value

IReadOnlyList<string>

Example

site."google.com" has the two names site and google.com.

Gets the parts of the key, without the dots between them.

public IReadOnlyList<SyntaxToken> Parts { get; }

Gets the parts of the key and the dots between them.

public SyntaxTokenList Tokens { get; }

Property value

SyntaxTokenList

Methods

NameDescription
Accept(TomlSyntaxVisitor)
Accept<TResult>(TomlSyntaxVisitor<TResult>)
Update(SyntaxTokenList)Returns this key with different tokens, or itself when nothing changed.
WithTokens(SyntaxTokenList)

Accept overloads

Accept(TomlSyntaxVisitor)

TomlKeySyntax.cs
public override void Accept(TomlSyntaxVisitor visitor)
Parameters
visitor TomlSyntaxVisitor

No documentation is available.

Accept<TResult>(TomlSyntaxVisitor<TResult>)

TomlKeySyntax.cs
public override TResult? Accept<TResult>(TomlSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor TomlSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

Update(SyntaxTokenList)

TomlKeySyntax.cs

Returns this key with different tokens, or itself when nothing changed.

public TomlKeySyntax Update(SyntaxTokenList tokens)

Parameters

tokens SyntaxTokenList

Returns

TomlKeySyntax

WithTokens(SyntaxTokenList)

TomlKeySyntax.cs
public TomlKeySyntax WithTokens(SyntaxTokenList tokens)

Parameters

tokens SyntaxTokenList

Returns

TomlKeySyntax

No documentation is available.