SyntaxNodeOrToken Struct
Either a node or a token, as they appear side by side among the children of a node.
public readonly struct SyntaxNodeOrToken : IEquatable<SyntaxNodeOrToken>Remarks
default is the token that is not there, matching SyntaxToken.None.
- Implements
Properties
| Name | Description |
|---|---|
| ContainsAnnotations | |
| ContainsDiagnostics | |
| ContainsSkippedText | |
| FullSpan | |
| IsMissing | |
| IsNode | |
| IsToken | |
| Parent | Gets the node this one is a child of. |
| RawKind | Gets the language-specific kind as a plain integer. |
| Span | |
| SpanStart |
ContainsAnnotations
SyntaxNodeOrToken.csContainsDiagnostics
SyntaxNodeOrToken.csContainsSkippedText
SyntaxNodeOrToken.csFullSpan
SyntaxNodeOrToken.csIsMissing
SyntaxNodeOrToken.csIsNode
SyntaxNodeOrToken.csIsToken
SyntaxNodeOrToken.csParent
SyntaxNodeOrToken.csRawKind
SyntaxNodeOrToken.csSpanStart
SyntaxNodeOrToken.csMethods
| Name | Description |
|---|---|
| AsNode() | Returns the node, or null when this is a token. |
| AsNode(SyntaxNode?) | Returns whether this is a node, and the node itself when it is. |
| AsToken() | Returns the token, or SyntaxToken.None when this is a node. |
| AsToken(SyntaxToken) | Returns whether this is a token, and the token itself when it is. |
| ChildNodesAndTokens() | Gets the children of the node, or nothing when this is a token. |
| Equals(SyntaxNodeOrToken) | |
| Equals(object?) | |
| FromNode(SyntaxNode) | Returns this as a node or token, for callers that cannot use the implicit conversion. |
| FromToken(SyntaxToken) | Returns this as a node or token, for callers that cannot use the implicit conversion. |
| GetHashCode() | |
| GetLeadingTrivia() | |
| GetTrailingTrivia() | |
| IsEquivalentTo(SyntaxNodeOrToken) | Determines whether the two have the same structure and text, ignoring their positions. |
| ToFullString() | |
| ToString() | |
| WriteTo(TextWriter) |
AsNode overloads
AsNode()
SyntaxNodeOrToken.csAsNode(SyntaxNode?)
SyntaxNodeOrToken.csReturns whether this is a node, and the node itself when it is.
public bool AsNode(out SyntaxNode? node)AsToken overloads
AsToken()
SyntaxNodeOrToken.csAsToken(SyntaxToken)
SyntaxNodeOrToken.csReturns whether this is a token, and the token itself when it is.
public bool AsToken(out SyntaxToken token)ChildNodesAndTokens()
SyntaxNodeOrToken.csGets the children of the node, or nothing when this is a token.
public ChildSyntaxList ChildNodesAndTokens()Returns
Equals overloads
Equals(SyntaxNodeOrToken)
SyntaxNodeOrToken.cspublic bool Equals(SyntaxNodeOrToken other)No documentation is available.
Equals(object?)
SyntaxNodeOrToken.csFromNode(SyntaxNode)
SyntaxNodeOrToken.csReturns this as a node or token, for callers that cannot use the implicit conversion.
public static SyntaxNodeOrToken FromNode(SyntaxNode node)FromToken(SyntaxToken)
SyntaxNodeOrToken.csReturns this as a node or token, for callers that cannot use the implicit conversion.
public static SyntaxNodeOrToken FromToken(SyntaxToken token)GetHashCode()
SyntaxNodeOrToken.csGetLeadingTrivia()
SyntaxNodeOrToken.csGetTrailingTrivia()
SyntaxNodeOrToken.csIsEquivalentTo(SyntaxNodeOrToken)
SyntaxNodeOrToken.csDetermines whether the two have the same structure and text, ignoring their positions.
public bool IsEquivalentTo(SyntaxNodeOrToken other)ToFullString()
SyntaxNodeOrToken.csToString()
SyntaxNodeOrToken.csWriteTo(TextWriter)
SyntaxNodeOrToken.cspublic void WriteTo(TextWriter writer)Operators
operator ==(SyntaxNodeOrToken, SyntaxNodeOrToken)
SyntaxNodeOrToken.cspublic static bool operator ==(SyntaxNodeOrToken left, SyntaxNodeOrToken right)No documentation is available.
op_Explicit overloads
explicit operator SyntaxNode?(SyntaxNodeOrToken)
SyntaxNodeOrToken.cspublic static explicit operator SyntaxNode?(SyntaxNodeOrToken nodeOrToken)No documentation is available.
explicit operator SyntaxToken(SyntaxNodeOrToken)
SyntaxNodeOrToken.cspublic static explicit operator SyntaxToken(SyntaxNodeOrToken nodeOrToken)No documentation is available.
op_Implicit overloads
implicit operator SyntaxNodeOrToken(SyntaxNode)
SyntaxNodeOrToken.cspublic static implicit operator SyntaxNodeOrToken(SyntaxNode node)No documentation is available.
implicit operator SyntaxNodeOrToken(SyntaxToken)
SyntaxNodeOrToken.cspublic static implicit operator SyntaxNodeOrToken(SyntaxToken token)No documentation is available.
operator !=(SyntaxNodeOrToken, SyntaxNodeOrToken)
SyntaxNodeOrToken.cspublic static bool operator !=(SyntaxNodeOrToken left, SyntaxNodeOrToken right)No documentation is available.