Search Results for

    Show / Hide Table of Contents

    Class LuaExtensions

    Extension methods for lua specific data.

    Inheritance
    System.Object
    LuaExtensions
    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 LuaExtensions

    Methods

    | Improve this Doc View Source

    GetCompilationUnitRoot(SyntaxTree, CancellationToken)

    Obtains the root as a CompilationUnitSyntax.

    Declaration
    public static CompilationUnitSyntax GetCompilationUnitRoot(this SyntaxTree tree, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    SyntaxTree tree
    CancellationToken cancellationToken
    Returns
    Type Description
    CompilationUnitSyntax
    | Improve this Doc View Source

    Insert(SyntaxTokenList, Int32, SyntaxToken[])

    Insert one or more tokens in the list at the specified index.

    Declaration
    public static SyntaxTokenList Insert(this SyntaxTokenList list, int index, params SyntaxToken[] items)
    Parameters
    Type Name Description
    SyntaxTokenList list
    System.Int32 index
    SyntaxToken[] items
    Returns
    Type Description
    SyntaxTokenList

    A new list with the tokens inserted.

    | Improve this Doc View Source

    IsKeyword(SyntaxToken)

    Returns whether the provided SyntaxToken is a Lua keyword.

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

    IsVerbatimStringLiteral(SyntaxToken)

    Returns whether a SyntaxToken is a verbatim string literal.

    Declaration
    public static bool IsVerbatimStringLiteral(this SyntaxToken token)
    Parameters
    Type Name Description
    SyntaxToken token
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Kind(SyntaxNode)

    Returns SyntaxKind for SyntaxNode from RawKind property.

    Declaration
    public static SyntaxKind Kind(this SyntaxNode node)
    Parameters
    Type Name Description
    SyntaxNode node
    Returns
    Type Description
    SyntaxKind
    | Improve this Doc View Source

    Kind(SyntaxNodeOrToken)

    Returns SyntaxKind for SyntaxNode from RawKind property.

    Declaration
    public static SyntaxKind Kind(this SyntaxNodeOrToken nodeOrToken)
    Parameters
    Type Name Description
    SyntaxNodeOrToken nodeOrToken
    Returns
    Type Description
    SyntaxKind
    | Improve this Doc View Source

    Kind(SyntaxToken)

    Returns SyntaxKind for SyntaxToken from RawKind property.

    Declaration
    public static SyntaxKind Kind(this SyntaxToken token)
    Parameters
    Type Name Description
    SyntaxToken token
    Returns
    Type Description
    SyntaxKind
    | Improve this Doc View Source

    Kind(SyntaxTrivia)

    Returns SyntaxKind for SyntaxTrivia from RawKind property.

    Declaration
    public static SyntaxKind Kind(this SyntaxTrivia trivia)
    Parameters
    Type Name Description
    SyntaxTrivia trivia
    Returns
    Type Description
    SyntaxKind
    | Improve this Doc View Source

    ReplaceTrivia(SyntaxToken, IEnumerable<SyntaxTrivia>, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia>)

    Creates a new token with the specified old trivia replaced with computed new trivia.

    Declaration
    public static SyntaxToken ReplaceTrivia(this SyntaxToken token, IEnumerable<SyntaxTrivia> trivia, Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia> computeReplacementTrivia)
    Parameters
    Type Name Description
    SyntaxToken token
    IEnumerable<SyntaxTrivia> trivia

    The trivia to be replaced; descendants of the root token.

    Func<SyntaxTrivia, SyntaxTrivia, SyntaxTrivia> computeReplacementTrivia

    A function that computes a replacement trivia for the argument trivia. The first argument is the original trivia. The second argument is the same trivia rewritten with replaced structure.

    Returns
    Type Description
    SyntaxToken
    | Improve this Doc View Source

    ReplaceTrivia(SyntaxToken, SyntaxTrivia, SyntaxTrivia)

    Creates a new token with the specified old trivia replaced with a new trivia. The old trivia may appear in the token's leading or trailing trivia.

    Declaration
    public static SyntaxToken ReplaceTrivia(this SyntaxToken token, SyntaxTrivia oldTrivia, SyntaxTrivia newTrivia)
    Parameters
    Type Name Description
    SyntaxToken token
    SyntaxTrivia oldTrivia

    The trivia to be replaced.

    SyntaxTrivia newTrivia

    The new trivia to use in the new tree in place of the old trivia.

    Returns
    Type Description
    SyntaxToken
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾