Search Results for

    Show / Hide Table of Contents

    Class SyntaxFacts

    A static class containing facts about Lua's Syntax.

    Inheritance
    System.Object
    SyntaxFacts
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Loretta.CodeAnalysis.Lua
    Assembly: Loretta.CodeAnalysis.Lua.dll
    Syntax
    public static class SyntaxFacts

    Properties

    | Improve this Doc View Source

    EqualityComparer

    A custom equality comparer for SyntaxKind

    Declaration
    public static IEqualityComparer<SyntaxKind> EqualityComparer { get; }
    Property Value
    Type Description
    IEqualityComparer<SyntaxKind>
    Remarks

    PERF: The framework specializes EqualityComparer for enums, but only if the underlying type is System.Int32 Since SyntaxKind's underlying type is System.UInt16, ObjectEqualityComparer will be chosen instead.

    Methods

    | Improve this Doc View Source

    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
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<SyntaxKind>

    A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.

    | Improve this Doc View Source

    GetBinaryExpressionKinds()

    Returns all SyntaxKinds that are in the BinaryExpression category.

    Declaration
    public static IEnumerable<SyntaxKind> GetBinaryExpressionKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    GetBinaryOperatorKinds()

    Returns all SyntaxKinds that can be considered binary operators.

    Declaration
    public static IEnumerable<SyntaxKind> GetBinaryOperatorKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    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
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Int32

    A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.

    | Improve this Doc View Source

    GetCompoundAssignmentOperator(SyntaxKind)

    Declaration
    public static Option<SyntaxKind> GetCompoundAssignmentOperator(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<SyntaxKind>
    | Improve this Doc View Source

    GetCompoundAssignmentOperatorTokenKinds()

    Returns all SyntaxKinds that are in the CompoundAssignmentOperatorToken category.

    Declaration
    public static IEnumerable<SyntaxKind> GetCompoundAssignmentOperatorTokenKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    GetCompoundAssignmentStatement(SyntaxKind)

    Declaration
    public static Option<SyntaxKind> GetCompoundAssignmentStatement(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<SyntaxKind>
    | Improve this Doc View Source

    GetCompoundAssignmentStatementKinds()

    Returns all SyntaxKinds that are in the CompoundAssignmentStatement category.

    Declaration
    public static IEnumerable<SyntaxKind> GetCompoundAssignmentStatementKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    GetConstantValue(SyntaxKind)

    Obtains the constant value of the token kind.

    Declaration
    public static Option<object> GetConstantValue(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<System.Object>
    | Improve this Doc View Source

    GetFunctionExpressionOrDeclarationKinds()

    Returns all SyntaxKinds that are in the FunctionExpressionOrDeclaration category.

    Declaration
    public static IEnumerable<SyntaxKind> GetFunctionExpressionOrDeclarationKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    GetKeywordKind(ReadOnlySpan<Char>)

    Returns the SyntaxKind for a given keyword or IdentifierName if not a keyword.

    Declaration
    public static SyntaxKind GetKeywordKind(ReadOnlySpan<char> span)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> span
    Returns
    Type Description
    SyntaxKind
    | Improve this Doc View Source

    GetKeywordKind(String)

    Returns the SyntaxKind for a given keyword or IdentifierName if not a keyword.

    Declaration
    public static SyntaxKind GetKeywordKind(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    SyntaxKind
    | Improve this Doc View Source

    GetLiteralExpression(SyntaxKind)

    Declaration
    public static Option<SyntaxKind> GetLiteralExpression(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<SyntaxKind>
    | Improve this Doc View Source

    GetLiteralTokenKinds()

    Returns all SyntaxKinds that are in the LiteralToken category.

    Declaration
    public static IEnumerable<SyntaxKind> GetLiteralTokenKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    GetOperatorTokenKind(SyntaxKind)

    Declaration
    public static Option<SyntaxKind> GetOperatorTokenKind(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<SyntaxKind>
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    Option<SyntaxKind>

    A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.

    | Improve this Doc View Source

    GetUnaryExpressionKinds()

    Returns all SyntaxKinds that are in the UnaryExpression category.

    Declaration
    public static IEnumerable<SyntaxKind> GetUnaryExpressionKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    GetUnaryOperatorKinds()

    Returns all SyntaxKinds that can be considered unary operators.

    Declaration
    public static IEnumerable<SyntaxKind> GetUnaryOperatorKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    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
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Int32

    A positive number indicating the binary operator precedence or 0 if the kind is not a binary operator.

    | Improve this Doc View Source

    GetVariableExpressionKinds()

    Returns all SyntaxKinds that are in the VariableExpression category.

    Declaration
    public static IEnumerable<SyntaxKind> GetVariableExpressionKinds()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<SyntaxKind>
    | Improve this Doc View Source

    HasKeywordBeenDisabled(SyntaxKind, LuaSyntaxOptions)

    Checks whether a keyword has been disabled by the syntaxOptions.

    Declaration
    public static bool HasKeywordBeenDisabled(SyntaxKind kind, LuaSyntaxOptions syntaxOptions)
    Parameters
    Type Name Description
    SyntaxKind kind

    The keyword's SyntaxKind.

    LuaSyntaxOptions syntaxOptions

    The LuaSyntaxOptions to check against.

    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsBinaryExpression(SyntaxKind)

    Checks whether the provided SyntaxKind is a binaryexpression's.

    Declaration
    public static bool IsBinaryExpression(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsBinaryOperatorToken(SyntaxKind)

    Checks whether the provided SyntaxKind is a binaryoperatortoken's.

    Declaration
    public static bool IsBinaryOperatorToken(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsComment(SyntaxKind)

    Checks whether a SyntaxKind is a comment's.

    Declaration
    public static bool IsComment(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsCompoundAssignmentOperatorToken(SyntaxKind)

    Checks whether the provided SyntaxKind is a compoundassignmentoperatortoken's.

    Declaration
    public static bool IsCompoundAssignmentOperatorToken(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsCompoundAssignmentStatement(SyntaxKind)

    Checks whether the provided SyntaxKind is a compoundassignmentstatement's.

    Declaration
    public static bool IsCompoundAssignmentStatement(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsContextualKeyword(SyntaxKind, LuaSyntaxOptions)

    Checks whether a given kind is a contextual keyword.

    Declaration
    public static bool IsContextualKeyword(SyntaxKind kind, LuaSyntaxOptions syntaxOptions)
    Parameters
    Type Name Description
    SyntaxKind kind
    LuaSyntaxOptions syntaxOptions
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsFunctionExpressionOrDeclaration(SyntaxKind)

    Checks whether the provided SyntaxKind is a functionexpressionordeclaration's.

    Declaration
    public static bool IsFunctionExpressionOrDeclaration(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsKeyword(SyntaxKind)

    Checks whether the provided SyntaxKind is a keyword's.

    Declaration
    public static bool IsKeyword(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLiteralToken(SyntaxKind)

    Checks whether the provided SyntaxKind is a literaltoken's.

    Declaration
    public static bool IsLiteralToken(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsOperatorToken(SyntaxKind)

    Checks whether the provided SyntaxKind is a operatortoken's.

    Declaration
    public static bool IsOperatorToken(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsReservedKeyword(SyntaxKind, LuaSyntaxOptions)

    Checks whether a given kind is a reserved keyword.

    Declaration
    public static bool IsReservedKeyword(SyntaxKind actual, LuaSyntaxOptions syntaxOptions)
    Parameters
    Type Name Description
    SyntaxKind actual
    LuaSyntaxOptions syntaxOptions
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsRightAssociative(SyntaxKind)

    Checks whether a given SyntaxKind is a right associative operator's.

    Declaration
    public static bool IsRightAssociative(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsToken(SyntaxKind)

    Checks whether the provided SyntaxKind is a token's.

    Declaration
    public static bool IsToken(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsTrivia(SyntaxKind)

    Checks whether the provided SyntaxKind is a trivia's.

    Declaration
    public static bool IsTrivia(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsUnaryExpression(SyntaxKind)

    Checks whether the provided SyntaxKind is a unaryexpression's.

    Declaration
    public static bool IsUnaryExpression(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsUnaryOperatorToken(SyntaxKind)

    Checks whether the provided SyntaxKind is a unaryoperatortoken's.

    Declaration
    public static bool IsUnaryOperatorToken(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsVariableExpression(SyntaxKind)

    Checks whether the provided SyntaxKind is a variableexpression's.

    Declaration
    public static bool IsVariableExpression(SyntaxKind kind)
    Parameters
    Type Name Description
    SyntaxKind kind
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾