Search Results for

    Show / Hide Table of Contents

    Struct SyntaxTokenList

    Represents a read-only list of SyntaxToken.

    Implements
    IEquatable<SyntaxTokenList>
    IReadOnlyList<SyntaxToken>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Loretta.CodeAnalysis
    Assembly: Loretta.CodeAnalysis.dll
    Syntax
    public readonly struct SyntaxTokenList

    Constructors

    | Improve this Doc View Source

    SyntaxTokenList(SyntaxToken)

    Creates a new token list with the provided token as its only element.

    Declaration
    public SyntaxTokenList(SyntaxToken token)
    Parameters
    Type Name Description
    SyntaxToken token
    | Improve this Doc View Source

    SyntaxTokenList(SyntaxToken[])

    Creates a list of tokens.

    Declaration
    public SyntaxTokenList(params SyntaxToken[] tokens)
    Parameters
    Type Name Description
    SyntaxToken[] tokens

    An array of tokens.

    | Improve this Doc View Source

    SyntaxTokenList(IEnumerable<SyntaxToken>)

    Creates a list of tokens.

    Declaration
    public SyntaxTokenList(IEnumerable<SyntaxToken> tokens)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<SyntaxToken> tokens

    Properties

    | Improve this Doc View Source

    Count

    Returns the number of tokens in the list.

    Declaration
    public readonly int Count { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    FullSpan

    The absolute span of the list elements in characters, including the leading and trailing trivia of the first and last elements.

    Declaration
    public readonly TextSpan FullSpan { get; }
    Property Value
    Type Description
    TextSpan
    | Improve this Doc View Source

    Item[Int32]

    Gets the token at the specified index.

    Declaration
    public readonly SyntaxToken this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the token to get.

    Property Value
    Type Description
    SyntaxToken

    The token at the specified index.

    | Improve this Doc View Source

    Span

    The absolute span of the list elements in characters, not including the leading and trailing trivia of the first and last elements.

    Declaration
    public readonly TextSpan Span { get; }
    Property Value
    Type Description
    TextSpan

    Methods

    | Improve this Doc View Source

    Add(SyntaxToken)

    Creates a new SyntaxTokenList with the specified token added to the end.

    Declaration
    public readonly SyntaxTokenList Add(SyntaxToken token)
    Parameters
    Type Name Description
    SyntaxToken token

    The token to add.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    AddRange(IEnumerable<SyntaxToken>)

    Creates a new SyntaxTokenList with the specified tokens added to the end.

    Declaration
    public readonly SyntaxTokenList AddRange(IEnumerable<SyntaxToken> tokens)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<SyntaxToken> tokens

    The tokens to add.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    Any()

    Tests whether the list is non-empty.

    Declaration
    public readonly bool Any()
    Returns
    Type Description
    System.Boolean

    True if the list contains any tokens.

    | Improve this Doc View Source

    Create(SyntaxToken)

    Create a new Token List

    Declaration
    public static SyntaxTokenList Create(SyntaxToken token)
    Parameters
    Type Name Description
    SyntaxToken token

    Element of the return Token List

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    Equals(SyntaxTokenList)

    Declaration
    public readonly bool Equals(SyntaxTokenList other)
    Parameters
    Type Name Description
    SyntaxTokenList other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Equals(Object)

    Compares this SyntaxTokenList with the obj for equality.

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean

    True if the two objects are equal.

    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    First()

    Returns the first token in the list.

    Declaration
    public readonly SyntaxToken First()
    Returns
    Type Description
    SyntaxToken

    The first token in the list.

    | Improve this Doc View Source

    GetEnumerator()

    Returns an enumerator for the tokens in the SyntaxTokenList

    Declaration
    public readonly SyntaxTokenList.Enumerator GetEnumerator()
    Returns
    Type Description
    SyntaxTokenList.Enumerator
    | Improve this Doc View Source

    GetHashCode()

    Serves as a hash function for the SyntaxTokenList

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc View Source

    IndexOf(SyntaxToken)

    Retuns the index of the provided token in this list.

    Declaration
    public readonly int IndexOf(SyntaxToken tokenInList)
    Parameters
    Type Name Description
    SyntaxToken tokenInList
    Returns
    Type Description
    System.Int32

    -1 if not found.

    | Improve this Doc View Source

    Insert(Int32, SyntaxToken)

    Creates a new SyntaxTokenList with the specified token insert at the index.

    Declaration
    public readonly SyntaxTokenList Insert(int index, SyntaxToken token)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert the new token.

    SyntaxToken token

    The token to insert.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    InsertRange(Int32, IEnumerable<SyntaxToken>)

    Creates a new SyntaxTokenList with the specified tokens insert at the index.

    Declaration
    public readonly SyntaxTokenList InsertRange(int index, IEnumerable<SyntaxToken> tokens)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert the new tokens.

    System.Collections.IEnumerable<SyntaxToken> tokens

    The tokens to insert.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    Last()

    Returns the last token in the list.

    Declaration
    public readonly SyntaxToken Last()
    Returns
    Type Description
    SyntaxToken

    The last token in the list.

    | Improve this Doc View Source

    Remove(SyntaxToken)

    Creates a new SyntaxTokenList with the specified token removed.

    Declaration
    public readonly SyntaxTokenList Remove(SyntaxToken tokenInList)
    Parameters
    Type Name Description
    SyntaxToken tokenInList

    The token to remove.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    RemoveAt(Int32)

    Creates a new SyntaxTokenList with the token at the specified index removed.

    Declaration
    public readonly SyntaxTokenList RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The index of the token to remove.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    Replace(SyntaxToken, SyntaxToken)

    Creates a new SyntaxTokenList with the specified token replaced with a new token.

    Declaration
    public readonly SyntaxTokenList Replace(SyntaxToken tokenInList, SyntaxToken newToken)
    Parameters
    Type Name Description
    SyntaxToken tokenInList

    The token to replace.

    SyntaxToken newToken

    The new token.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    ReplaceRange(SyntaxToken, IEnumerable<SyntaxToken>)

    Creates a new SyntaxTokenList with the specified token replaced with new tokens.

    Declaration
    public readonly SyntaxTokenList ReplaceRange(SyntaxToken tokenInList, IEnumerable<SyntaxToken> newTokens)
    Parameters
    Type Name Description
    SyntaxToken tokenInList

    The token to replace.

    System.Collections.IEnumerable<SyntaxToken> newTokens

    The new tokens.

    Returns
    Type Description
    SyntaxTokenList
    | Improve this Doc View Source

    Reverse()

    Returns a list which contains all elements of SyntaxTokenList in reversed order.

    Declaration
    public readonly SyntaxTokenList.Reversed Reverse()
    Returns
    Type Description
    SyntaxTokenList.Reversed

    SyntaxTokenList.Reversed which contains all elements of SyntaxTokenList in reversed order

    | Improve this Doc View Source

    ToFullString()

    Returns the full string representation of the tokens in this list including the first token's leading trivia and the last token's trailing trivia.

    Declaration
    public readonly string ToFullString()
    Returns
    Type Description
    System.String

    The full string representation of the tokens in this list including the first token's leading trivia and the last token's trailing trivia.

    | Improve this Doc View Source

    ToString()

    Returns the string representation of the tokens in this list, not including the first token's leading trivia and the last token's trailing trivia.

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    System.String

    The string representation of the tokens in this list, not including the first token's leading trivia and the last token's trailing trivia.

    Overrides
    System.ValueType.ToString()

    Operators

    | Improve this Doc View Source

    Equality(SyntaxTokenList, SyntaxTokenList)

    Compares left and right for equality.

    Declaration
    public static bool operator ==(SyntaxTokenList left, SyntaxTokenList right)
    Parameters
    Type Name Description
    SyntaxTokenList left
    SyntaxTokenList right
    Returns
    Type Description
    System.Boolean

    True if the two SyntaxTokenLists are equal.

    | Improve this Doc View Source

    Inequality(SyntaxTokenList, SyntaxTokenList)

    Compares left and right for inequality.

    Declaration
    public static bool operator !=(SyntaxTokenList left, SyntaxTokenList right)
    Parameters
    Type Name Description
    SyntaxTokenList left
    SyntaxTokenList right
    Returns
    Type Description
    System.Boolean

    True if the two SyntaxTokenLists are not equal.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IEnumerable.GetEnumerator()

    Declaration
    readonly IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Implements

    IEquatable<>
    IReadOnlyList<>

    Extension Methods

    LuaExtensions.IndexOf(SyntaxTokenList, SyntaxKind)
    LuaExtensions.Any(SyntaxTokenList, SyntaxKind)
    LuaExtensions.Insert(SyntaxTokenList, Int32, SyntaxToken[])
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾