Class SyntaxFacts
A static class containing facts about Lua's Syntax.
Inheritance
System.Object
SyntaxFacts
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: cs.temp.dll.dll
Syntax
public static class SyntaxFacts
Properties
EqualityComparer
Declaration
public static IEqualityComparer<SyntaxKind> EqualityComparer { get; }
Property Value
Methods
GetBinaryExpression(SyntaxKind)
Returns the expression kind for a given unary operator or None if not a unary operator.
Declaration
public static Option<SyntaxKind> GetBinaryExpression(SyntaxKind kind)
Parameters
Returns
Type |
Description |
Option<SyntaxKind> |
A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.
|
GetBinaryExpressionKinds()
Returns all SyntaxKinds that are in the BinaryExpression category.
Declaration
public static IEnumerable<SyntaxKind> GetBinaryExpressionKinds()
Returns
GetBinaryOperatorKinds()
Returns all SyntaxKinds that can be considered binary operators.
Declaration
public static IEnumerable<SyntaxKind> GetBinaryOperatorKinds()
Returns
GetBinaryOperatorPrecedence(SyntaxKind)
Returns the precedence for a given binary operator. Returns 0 if kind is not a binary operator.
Declaration
public static int GetBinaryOperatorPrecedence(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Int32 |
A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.
|
GetCompoundAssignmentOperator(SyntaxKind)
Declaration
public static Option<SyntaxKind> GetCompoundAssignmentOperator(SyntaxKind kind)
Parameters
Returns
GetCompoundAssignmentOperatorTokenKinds()
Returns all SyntaxKinds that are in the CompoundAssignmentOperatorToken category.
Declaration
public static IEnumerable<SyntaxKind> GetCompoundAssignmentOperatorTokenKinds()
Returns
GetCompoundAssignmentStatement(SyntaxKind)
Declaration
public static Option<SyntaxKind> GetCompoundAssignmentStatement(SyntaxKind kind)
Parameters
Returns
GetCompoundAssignmentStatementKinds()
Returns all SyntaxKinds that are in the CompoundAssignmentStatement category.
Declaration
public static IEnumerable<SyntaxKind> GetCompoundAssignmentStatementKinds()
Returns
GetConstantValue(SyntaxKind)
Obtains the constant value of the token kind.
Declaration
public static Option<object> GetConstantValue(SyntaxKind kind)
Parameters
Returns
Type |
Description |
Option<System.Object> |
|
GetFunctionExpressionOrDeclarationKinds()
Returns all SyntaxKinds that are in the FunctionExpressionOrDeclaration category.
Declaration
public static IEnumerable<SyntaxKind> GetFunctionExpressionOrDeclarationKinds()
Returns
GetKeywordKind(ReadOnlySpan<Char>)
Declaration
public static SyntaxKind GetKeywordKind(ReadOnlySpan<char> span)
Parameters
Type |
Name |
Description |
ReadOnlySpan<System.Char> |
span |
|
Returns
GetKeywordKind(String)
Declaration
public static SyntaxKind GetKeywordKind(String text)
Parameters
Type |
Name |
Description |
String |
text |
|
Returns
GetLiteralExpression(SyntaxKind)
Declaration
public static Option<SyntaxKind> GetLiteralExpression(SyntaxKind kind)
Parameters
Returns
GetLiteralTokenKinds()
Returns all SyntaxKinds that are in the LiteralToken category.
Declaration
public static IEnumerable<SyntaxKind> GetLiteralTokenKinds()
Returns
GetOperatorTokenKind(SyntaxKind)
Declaration
public static Option<SyntaxKind> GetOperatorTokenKind(SyntaxKind kind)
Parameters
Returns
GetText(SyntaxKind)
Gets the predefined text that corresponds to the provided syntax kind.
Declaration
public static string GetText(SyntaxKind kind)
Parameters
Type |
Name |
Description |
SyntaxKind |
kind |
The kind to obtain the text for.
|
Returns
Type |
Description |
System.String |
The text corresponding to the provided kind or System.String.Empty if none.
|
GetUnaryExpression(SyntaxKind)
Returns the expression kind for a given unary operator or None if not a unary operator.
Declaration
public static Option<SyntaxKind> GetUnaryExpression(SyntaxKind kind)
Parameters
Returns
Type |
Description |
Option<SyntaxKind> |
A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.
|
GetUnaryExpressionKinds()
Returns all SyntaxKinds that are in the UnaryExpression category.
Declaration
public static IEnumerable<SyntaxKind> GetUnaryExpressionKinds()
Returns
GetUnaryOperatorKinds()
Returns all SyntaxKinds that can be considered unary operators.
Declaration
public static IEnumerable<SyntaxKind> GetUnaryOperatorKinds()
Returns
GetUnaryOperatorPrecedence(SyntaxKind)
Returns the precedence for a given unary operator or 0 if not a unary operator.
Declaration
public static int GetUnaryOperatorPrecedence(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Int32 |
A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.
|
GetVariableExpressionKinds()
Returns all SyntaxKinds that are in the VariableExpression category.
Declaration
public static IEnumerable<SyntaxKind> GetVariableExpressionKinds()
Returns
HasKeywordBeenDisabled(SyntaxKind, LuaSyntaxOptions)
Checks whether a keyword has been disabled by the syntaxOptions
.
Declaration
public static bool HasKeywordBeenDisabled(SyntaxKind kind, LuaSyntaxOptions syntaxOptions)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsBinaryExpression(SyntaxKind)
Checks whether the provided SyntaxKind is a binaryexpression's.
Declaration
public static bool IsBinaryExpression(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsBinaryOperatorToken(SyntaxKind)
Checks whether the provided SyntaxKind is a binaryoperatortoken's.
Declaration
public static bool IsBinaryOperatorToken(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Declaration
public static bool IsComment(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsCompoundAssignmentOperatorToken(SyntaxKind)
Checks whether the provided SyntaxKind is a compoundassignmentoperatortoken's.
Declaration
public static bool IsCompoundAssignmentOperatorToken(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsCompoundAssignmentStatement(SyntaxKind)
Checks whether the provided SyntaxKind is a compoundassignmentstatement's.
Declaration
public static bool IsCompoundAssignmentStatement(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsContextualKeyword(SyntaxKind, LuaSyntaxOptions)
Checks whether a given kind is a contextual keyword.
Declaration
public static bool IsContextualKeyword(SyntaxKind kind, LuaSyntaxOptions syntaxOptions)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsFunctionExpressionOrDeclaration(SyntaxKind)
Checks whether the provided SyntaxKind is a functionexpressionordeclaration's.
Declaration
public static bool IsFunctionExpressionOrDeclaration(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsKeyword(SyntaxKind)
Checks whether the provided SyntaxKind is a keyword's.
Declaration
public static bool IsKeyword(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsLiteralToken(SyntaxKind)
Checks whether the provided SyntaxKind is a literaltoken's.
Declaration
public static bool IsLiteralToken(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsOperatorToken(SyntaxKind)
Checks whether the provided SyntaxKind is a operatortoken's.
Declaration
public static bool IsOperatorToken(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsReservedKeyword(SyntaxKind, LuaSyntaxOptions)
Checks whether a given kind is a reserved keyword.
Declaration
public static bool IsReservedKeyword(SyntaxKind actual, LuaSyntaxOptions syntaxOptions)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsRightAssociative(SyntaxKind)
Checks whether a given SyntaxKind is a right associative operator's.
Declaration
public static bool IsRightAssociative(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsToken(SyntaxKind)
Checks whether the provided SyntaxKind is a token's.
Declaration
public static bool IsToken(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsTrivia(SyntaxKind)
Checks whether the provided SyntaxKind is a trivia's.
Declaration
public static bool IsTrivia(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsUnaryExpression(SyntaxKind)
Checks whether the provided SyntaxKind is a unaryexpression's.
Declaration
public static bool IsUnaryExpression(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsUnaryOperatorToken(SyntaxKind)
Checks whether the provided SyntaxKind is a unaryoperatortoken's.
Declaration
public static bool IsUnaryOperatorToken(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsVariableExpression(SyntaxKind)
Checks whether the provided SyntaxKind is a variableexpression's.
Declaration
public static bool IsVariableExpression(SyntaxKind kind)
Parameters
Returns
Type |
Description |
System.Boolean |
|