SyntaxFacts Class

Answers questions about TOML kinds that do not need a tree.

public static class SyntaxFacts

Methods

NameDescription
GetText(SyntaxKind)Gets the text a kind is always spelled with, or an empty string when it varies.
GetValueKind(SyntaxKind)Gets the kind of the value node that wraps a token, or SyntaxKind.None when no value node does.
IsAnyToken(SyntaxKind)
IsBareKey(string)Determines whether text can be written as a key without quotes.
IsDateTimeToken(SyntaxKind)Determines whether a kind is one of the tokens that spell a date, a time, or both.
IsEntry(SyntaxKind)
IsKeyToken(SyntaxKind)Determines whether a kind is one of the tokens a key can be made of.
IsPunctuation(SyntaxKind)
IsStringToken(SyntaxKind)Determines whether a kind is one of the tokens that spell a string.
IsTrivia(SyntaxKind)
IsValue(SyntaxKind)Determines whether a kind is one of the nodes that can appear where a value is expected.

GetText(SyntaxKind)

SyntaxFacts.cs

Gets the text a kind is always spelled with, or an empty string when it varies.

public static string GetText(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

string

GetValueKind(SyntaxKind)

SyntaxFacts.cs

Gets the kind of the value node that wraps a token, or SyntaxKind.None when no value node does.

public static SyntaxKind GetValueKind(SyntaxKind tokenKind)

Parameters

tokenKind SyntaxKind

Returns

SyntaxKind

IsAnyToken(SyntaxKind)

SyntaxFacts.cs
public static bool IsAnyToken(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsBareKey(string)

SyntaxFacts.cs

Determines whether text can be written as a key without quotes.

public static bool IsBareKey(string text)

Parameters

text string

Returns

bool

Exceptions

ArgumentNullException
text is null.

IsDateTimeToken(SyntaxKind)

SyntaxFacts.cs

Determines whether a kind is one of the tokens that spell a date, a time, or both.

public static bool IsDateTimeToken(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

IsEntry(SyntaxKind)

SyntaxFacts.cs
public static bool IsEntry(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsKeyToken(SyntaxKind)

SyntaxFacts.cs

Determines whether a kind is one of the tokens a key can be made of.

public static bool IsKeyToken(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

Remarks

Multi-line strings are strings, but not keys.

IsPunctuation(SyntaxKind)

SyntaxFacts.cs
public static bool IsPunctuation(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsStringToken(SyntaxKind)

SyntaxFacts.cs

Determines whether a kind is one of the tokens that spell a string.

public static bool IsStringToken(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

IsTrivia(SyntaxKind)

SyntaxFacts.cs
public static bool IsTrivia(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool

No documentation is available.

IsValue(SyntaxKind)

SyntaxFacts.cs

Determines whether a kind is one of the nodes that can appear where a value is expected.

public static bool IsValue(SyntaxKind kind)

Parameters

kind SyntaxKind

Returns

bool