Struct SyntaxNodeOrTokenList
A list of SyntaxNodeOrToken structures.
Inherited Members
Namespace: Loretta.CodeAnalysis
Assembly: Loretta.CodeAnalysis.dll
Syntax
public readonly struct SyntaxNodeOrTokenList
Constructors
| Improve this Doc View SourceSyntaxNodeOrTokenList(SyntaxNodeOrToken[])
Create a SyntaxNodeOrTokenList from one or more SyntaxNodeOrToken.
Declaration
public SyntaxNodeOrTokenList(params SyntaxNodeOrToken[] nodesAndTokens)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken[] | nodesAndTokens | The nodes and tokens |
SyntaxNodeOrTokenList(IEnumerable<SyntaxNodeOrToken>)
Create a SyntaxNodeOrTokenList from a sequence of SyntaxNodeOrToken.
Declaration
public SyntaxNodeOrTokenList(IEnumerable<SyntaxNodeOrToken> nodesAndTokens)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable<SyntaxNodeOrToken> | nodesAndTokens | The sequence of nodes and tokens |
Properties
| Improve this Doc View SourceCount
Gets the count of nodes in this list
Declaration
public readonly int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
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 |
Item[Int32]
Gets the SyntaxNodeOrToken at the specified index.
Declaration
public readonly SyntaxNodeOrToken this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
SyntaxNodeOrToken |
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 SourceAdd(SyntaxNodeOrToken)
Creates a new SyntaxNodeOrTokenList with the specified node or token added to the end.
Declaration
public readonly SyntaxNodeOrTokenList Add(SyntaxNodeOrToken nodeOrToken)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken | nodeOrToken | The node or token to add. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
AddRange(IEnumerable<SyntaxNodeOrToken>)
Creates a new SyntaxNodeOrTokenList with the specified nodes or tokens added to the end.
Declaration
public readonly SyntaxNodeOrTokenList AddRange(IEnumerable<SyntaxNodeOrToken> nodesOrTokens)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerable<SyntaxNodeOrToken> | nodesOrTokens | The nodes or tokens to add. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
Any()
Indicates whether there is any element in the list.
Declaration
public readonly bool Any()
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(SyntaxNodeOrTokenList)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(SyntaxNodeOrTokenList other)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrTokenList | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override readonly bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
First()
Gets the first SyntaxNodeOrToken structure from this list.
Declaration
public readonly SyntaxNodeOrToken First()
Returns
Type | Description |
---|---|
SyntaxNodeOrToken |
FirstOrDefault()
Gets the first SyntaxNodeOrToken structure from this list if present, else default(SyntaxNodeOrToken).
Declaration
public readonly SyntaxNodeOrToken FirstOrDefault()
Returns
Type | Description |
---|---|
SyntaxNodeOrToken |
GetEnumerator()
Gets the enumerator.
Declaration
public readonly SyntaxNodeOrTokenList.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList.Enumerator |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
IndexOf(SyntaxNodeOrToken)
Returns the index from the list for the given SyntaxNodeOrToken.
Declaration
public readonly int IndexOf(SyntaxNodeOrToken nodeOrToken)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken | nodeOrToken | The node or token to search for in the list. |
Returns
Type | Description |
---|---|
System.Int32 | The index of the found nodeOrToken, or -1 if it wasn't found |
Insert(Int32, SyntaxNodeOrToken)
Creates a new SyntaxNodeOrTokenList with the specified node or token inserted at the index.
Declaration
public readonly SyntaxNodeOrTokenList Insert(int index, SyntaxNodeOrToken nodeOrToken)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to insert at. |
SyntaxNodeOrToken | nodeOrToken | The node or token to insert. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
InsertRange(Int32, IEnumerable<SyntaxNodeOrToken>)
Creates a new SyntaxNodeOrTokenList with the specified nodes or tokens inserted at the index.
Declaration
public readonly SyntaxNodeOrTokenList InsertRange(int index, IEnumerable<SyntaxNodeOrToken> nodesAndTokens)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index to insert at. |
System.Collections.IEnumerable<SyntaxNodeOrToken> | nodesAndTokens | The nodes or tokens to insert. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
Last()
Gets the last SyntaxNodeOrToken structure from this list.
Declaration
public readonly SyntaxNodeOrToken Last()
Returns
Type | Description |
---|---|
SyntaxNodeOrToken |
LastOrDefault()
Gets the last SyntaxNodeOrToken structure from this list if present, else default(SyntaxNodeOrToken).
Declaration
public readonly SyntaxNodeOrToken LastOrDefault()
Returns
Type | Description |
---|---|
SyntaxNodeOrToken |
Remove(SyntaxNodeOrToken)
Creates a new SyntaxNodeOrTokenList with the specified element removed.
Declaration
public readonly SyntaxNodeOrTokenList Remove(SyntaxNodeOrToken nodeOrTokenInList)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken | nodeOrTokenInList | The element to remove. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
RemoveAt(Int32)
Creates a new SyntaxNodeOrTokenList with the element at the specified index removed.
Declaration
public readonly SyntaxNodeOrTokenList RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the element to remove. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
Replace(SyntaxNodeOrToken, SyntaxNodeOrToken)
Creates a new SyntaxNodeOrTokenList with the specified element replaced with a new node or token.
Declaration
public readonly SyntaxNodeOrTokenList Replace(SyntaxNodeOrToken nodeOrTokenInList, SyntaxNodeOrToken newNodeOrToken)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken | nodeOrTokenInList | The element to replace. |
SyntaxNodeOrToken | newNodeOrToken | The new node or token. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
ReplaceRange(SyntaxNodeOrToken, IEnumerable<SyntaxNodeOrToken>)
Creates a new SyntaxNodeOrTokenList with the specified element replaced with a new nodes and tokens.
Declaration
public readonly SyntaxNodeOrTokenList ReplaceRange(SyntaxNodeOrToken nodeOrTokenInList, IEnumerable<SyntaxNodeOrToken> newNodesAndTokens)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrToken | nodeOrTokenInList | The element to replace. |
System.Collections.IEnumerable<SyntaxNodeOrToken> | newNodesAndTokens | The new nodes and tokens. |
Returns
Type | Description |
---|---|
SyntaxNodeOrTokenList |
ToFullString()
Returns the full string representation of the nodes and tokens in this list including the first node or token's leading trivia and the last node or token's trailing trivia.
Declaration
public readonly string ToFullString()
Returns
Type | Description |
---|---|
System.String | The full string representation of the nodes and tokens in this list including the first node or token's leading trivia and the last node or token's trailing trivia. |
ToString()
Returns the string representation of the nodes and tokens in this list, not including the first node or token's leading trivia and the last node or token's trailing trivia.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
System.String | The string representation of the nodes and tokens in this list, not including the first node or token's leading trivia and the last node or token's trailing trivia. |
Overrides
Operators
| Improve this Doc View SourceEquality(SyntaxNodeOrTokenList, SyntaxNodeOrTokenList)
Implements the operator ==.
Declaration
public static bool operator ==(SyntaxNodeOrTokenList left, SyntaxNodeOrTokenList right)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrTokenList | left | The left SyntaxNodeOrTokenList |
SyntaxNodeOrTokenList | right | The right SyntaxNodeOrTokenList |
Returns
Type | Description |
---|---|
System.Boolean |
|
Inequality(SyntaxNodeOrTokenList, SyntaxNodeOrTokenList)
Implements the operator !=.
Declaration
public static bool operator !=(SyntaxNodeOrTokenList left, SyntaxNodeOrTokenList right)
Parameters
Type | Name | Description |
---|---|---|
SyntaxNodeOrTokenList | left | The left SyntaxNodeOrTokenList |
SyntaxNodeOrTokenList | right | The right SyntaxNodeOrTokenList |
Returns
Type | Description |
---|---|
System.Boolean |
|
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
readonly IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |