Delen via


SyntaxTokenList Struct

Definition

Represents a read-only list of SyntaxToken.

public value class SyntaxTokenList : IEquatable<Microsoft::CodeAnalysis::SyntaxTokenList>, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::SyntaxToken>, System::Collections::Generic::IReadOnlyCollection<Microsoft::CodeAnalysis::SyntaxToken>, System::Collections::Generic::IReadOnlyList<Microsoft::CodeAnalysis::SyntaxToken>
public readonly struct SyntaxTokenList : IEquatable<Microsoft.CodeAnalysis.SyntaxTokenList>, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken>, System.Collections.Generic.IReadOnlyCollection<Microsoft.CodeAnalysis.SyntaxToken>, System.Collections.Generic.IReadOnlyList<Microsoft.CodeAnalysis.SyntaxToken>
type SyntaxTokenList = struct
    interface IReadOnlyList<SyntaxToken>
    interface seq<SyntaxToken>
    interface IEnumerable
    interface IReadOnlyCollection<SyntaxToken>
Public Structure SyntaxTokenList
Implements IEnumerable(Of SyntaxToken), IEquatable(Of SyntaxTokenList), IReadOnlyCollection(Of SyntaxToken), IReadOnlyList(Of SyntaxToken)
Inheritance
SyntaxTokenList
Implements

Constructors

SyntaxTokenList(IEnumerable<SyntaxToken>)

Creates a list of tokens.

SyntaxTokenList(SyntaxToken)
SyntaxTokenList(SyntaxToken[])

Creates a list of tokens.

Properties

Count

Returns the number of tokens in the list.

FullSpan

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

Item[Int32]

Gets the token at the specified index.

Span

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

Methods

Add(SyntaxToken)

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

AddRange(IEnumerable<SyntaxToken>)

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

Any()

Tests whether the list is non-empty.

Create(ReadOnlySpan<SyntaxToken>)
Create(SyntaxToken)

Create a new Token List

Equals(Object)

Compares this SyntaxTokenList with the obj for equality.

Equals(SyntaxTokenList)
First()

Returns the first token in the list.

GetEnumerator()

Returns an enumerator for the tokens in the SyntaxTokenList

GetHashCode()

Serves as a hash function for the SyntaxTokenList

IndexOf(SyntaxToken)
Insert(Int32, SyntaxToken)

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

InsertRange(Int32, IEnumerable<SyntaxToken>)

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

Last()

Returns the last token in the list.

Remove(SyntaxToken)

Creates a new SyntaxTokenList with the specified token removed.

RemoveAt(Int32)

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

Replace(SyntaxToken, SyntaxToken)

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

ReplaceRange(SyntaxToken, IEnumerable<SyntaxToken>)

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

Reverse()

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

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.

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.

Operators

Equality(SyntaxTokenList, SyntaxTokenList)

Compares left and right for equality.

Inequality(SyntaxTokenList, SyntaxTokenList)

Compares left and right for inequality.

Explicit Interface Implementations

IEnumerable.GetEnumerator()
IEnumerable<SyntaxToken>.GetEnumerator()

Extension Methods

Insert(SyntaxTokenList, Int32, SyntaxToken[])

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

Any(SyntaxTokenList, SyntaxKind)

Tests whether a list contains a token of a particular kind.

IndexOf(SyntaxTokenList, SyntaxKind)

Returns the index of the first token of a specified kind in the token list.

Add(SyntaxTokenList, SyntaxToken[])

Add one or more tokens to the end of the list.

Insert(SyntaxTokenList, Int32, SyntaxToken[])

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

Any(SyntaxTokenList, SyntaxKind)

Tests whether a list contains token of a particular kind.

IndexOf(SyntaxTokenList, SyntaxKind)

Returns the index of the first token of a specified kind in the token list.

Applies to