Arguments
SyntaxNodesAB.swift:2326enum Arguments
enum Arguments
import SwiftSyntax
A library for working with Swift code.
struct AttributeSyntax
An @
attribute.
case argumentList(LabeledExprListSyntax)
case token(TokenSyntax)
case string(StringLiteralExprSyntax)
case availability(AvailabilityArgumentListSyntax)
case specializeArguments(SpecializeAttributeArgumentListSyntax)
case objCName(ObjCSelectorPieceListSyntax)
case implementsArguments(ImplementsAttributeArgumentsSyntax)
case differentiableArguments(DifferentiableAttributeArgumentsSyntax)
case derivativeRegistrationArguments(DerivativeAttributeArgumentsSyntax)
case backDeployedArguments(BackDeployedAttributeArgumentsSyntax)
case conventionArguments(ConventionAttributeArgumentsSyntax)
case conventionWitnessMethodArguments(ConventionWitnessMethodAttributeArgumentsSyntax)
case opaqueReturnTypeOfAttributeArguments(OpaqueReturnTypeOfAttributeArgumentsSyntax)
case exposeAttributeArguments(ExposeAttributeArgumentsSyntax)
case originallyDefinedInArguments(OriginallyDefinedInAttributeArgumentsSyntax)
case underscorePrivateAttributeArguments(UnderscorePrivateAttributeArgumentsSyntax)
case dynamicReplacementArguments(DynamicReplacementAttributeArgumentsSyntax)
case unavailableFromAsyncArguments(UnavailableFromAsyncAttributeArgumentsSyntax)
case effectsArguments(EffectsAttributeArgumentListSyntax)
case documentationArguments(DocumentationAttributeArgumentListSyntax)
init?(_ node: some SyntaxProtocol)
init(leadingTrivia: Trivia? = nil, _ unexpectedBeforeAtSign: UnexpectedNodesSyntax? = nil, atSign: TokenSyntax = .atSignToken(), _ unexpectedBetweenAtSignAndAttributeName: UnexpectedNodesSyntax? = nil, attributeName: some TypeSyntaxProtocol, _ unexpectedBetweenAttributeNameAndLeftParen: UnexpectedNodesSyntax? = nil, leftParen: TokenSyntax? = nil, _ unexpectedBetweenLeftParenAndArguments: UnexpectedNodesSyntax? = nil, arguments: Arguments? = nil, _ unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? = nil, rightParen: TokenSyntax? = nil, _ unexpectedAfterRightParen: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil)
static let structure: SyntaxNodeStructure
let _syntaxNode: Syntax
var arguments: Arguments? { get set }
The arguments of the attribute.
var atSign: TokenSyntax { get set }
The @
sign.
var attributeName: TypeSyntax { get set }
The name of the attribute.
var leftParen: TokenSyntax? { get set }
If the attribute takes arguments, the opening parenthesis.
var rightParen: TokenSyntax? { get set }
If the attribute takes arguments, the closing parenthesis.
var unexpectedAfterRightParen: UnexpectedNodesSyntax? { get set }
var unexpectedBeforeAtSign: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenArgumentsAndRightParen: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenAtSignAndAttributeName: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenAttributeNameAndLeftParen: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenLeftParenAndArguments: UnexpectedNodesSyntax? { get set }
init(leadingTrivia: Trivia? = nil, _ unexpectedBeforeAtSignToken: UnexpectedNodesSyntax? = nil, atSignToken: TokenSyntax = .atSignToken(), _ unexpectedBetweenAtSignTokenAndAttributeName: UnexpectedNodesSyntax? = nil, attributeName: some TypeSyntaxProtocol, _ unexpectedBetweenAttributeNameAndLeftParen: UnexpectedNodesSyntax? = nil, leftParen: TokenSyntax? = nil, _ unexpectedBetweenLeftParenAndArgument: UnexpectedNodesSyntax? = nil, argument: Arguments? = nil, _ unexpectedBetweenArgumentAndRightParen: UnexpectedNodesSyntax? = nil, rightParen: TokenSyntax? = nil, _ unexpectedAfterRightParen: UnexpectedNodesSyntax? = nil, trailingTrivia: Trivia? = nil)
var argument: Arguments? { get set }
var atSignToken: TokenSyntax { get set }
var unexpectedBeforeAtSignToken: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenArgumentAndRightParen: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenAtSignTokenAndAttributeName: UnexpectedNodesSyntax? { get set }
var unexpectedBetweenLeftParenAndArgument: UnexpectedNodesSyntax? { get set }
typealias Argument = Arguments
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomReflectable
A type that explicitly supplies its own mirror.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
protocol SyntaxChildChoices : SyntaxProtocol
Protocol for the enums nested inside Syntax
nodes that enumerate all the possible types a child node might have.
protocol SyntaxHashable : Hashable
Protocol that provides a common Hashable implementation for all syntax nodes
protocol SyntaxProtocol : CustomDebugStringConvertible, CustomReflectable, CustomStringConvertible, Sendable, TextOutputStreamable
Provide common functionality for specialized syntax nodes. Extend this protocol to provide common functionality for all syntax nodes.
protocol TextOutputStreamable
A source of text-streaming operations.
init?(_ node: some SyntaxProtocol)
init(_ node: ConventionAttributeArgumentsSyntax)
init(_ node: DerivativeAttributeArgumentsSyntax)
init(_ node: ImplementsAttributeArgumentsSyntax)
init(_ node: SpecializeAttributeArgumentListSyntax)
init(_ node: BackDeployedAttributeArgumentsSyntax)
init(_ node: DocumentationAttributeArgumentListSyntax)
init(_ node: DifferentiableAttributeArgumentsSyntax)
init(_ node: LabeledExprListSyntax)
init(_ node: StringLiteralExprSyntax)
init(_ node: UnderscorePrivateAttributeArgumentsSyntax)
init(_ node: DynamicReplacementAttributeArgumentsSyntax)
init(_ node: OpaqueReturnTypeOfAttributeArgumentsSyntax)
init(_ node: OriginallyDefinedInAttributeArgumentsSyntax)
init(_ node: UnavailableFromAsyncAttributeArgumentsSyntax)
init(_ node: ObjCSelectorPieceListSyntax)
init(_ node: ConventionWitnessMethodAttributeArgumentsSyntax)
init(_ node: AvailabilityArgumentListSyntax)
init(_ node: TokenSyntax)
init(_ node: ExposeAttributeArgumentsSyntax)
init(_ node: EffectsAttributeArgumentListSyntax)
static var structure: SyntaxNodeStructure { get }
var _syntaxNode: Syntax { get }
func `as`(_ syntaxType: ConventionAttributeArgumentsSyntax.Type) -> ConventionAttributeArgumentsSyntax?
Attempts to cast the current syntax node to ConventionAttributeArgumentsSyntax
.
func `as`(_ syntaxType: DerivativeAttributeArgumentsSyntax.Type) -> DerivativeAttributeArgumentsSyntax?
Attempts to cast the current syntax node to DerivativeAttributeArgumentsSyntax
.
func `as`(_ syntaxType: ImplementsAttributeArgumentsSyntax.Type) -> ImplementsAttributeArgumentsSyntax?
Attempts to cast the current syntax node to ImplementsAttributeArgumentsSyntax
.
func `as`(_ syntaxType: SpecializeAttributeArgumentListSyntax.Type) -> SpecializeAttributeArgumentListSyntax?
Attempts to cast the current syntax node to SpecializeAttributeArgumentListSyntax
.
func `as`(_ syntaxType: BackDeployedAttributeArgumentsSyntax.Type) -> BackDeployedAttributeArgumentsSyntax?
Attempts to cast the current syntax node to BackDeployedAttributeArgumentsSyntax
.
func `as`(_ syntaxType: DocumentationAttributeArgumentListSyntax.Type) -> DocumentationAttributeArgumentListSyntax?
Attempts to cast the current syntax node to DocumentationAttributeArgumentListSyntax
.
func `as`(_ syntaxType: DifferentiableAttributeArgumentsSyntax.Type) -> DifferentiableAttributeArgumentsSyntax?
Attempts to cast the current syntax node to DifferentiableAttributeArgumentsSyntax
.
func `as`(_ syntaxType: LabeledExprListSyntax.Type) -> LabeledExprListSyntax?
Attempts to cast the current syntax node to LabeledExprListSyntax
.
func `as`(_ syntaxType: StringLiteralExprSyntax.Type) -> StringLiteralExprSyntax?
Attempts to cast the current syntax node to StringLiteralExprSyntax
.
func `as`(_ syntaxType: UnderscorePrivateAttributeArgumentsSyntax.Type) -> UnderscorePrivateAttributeArgumentsSyntax?
Attempts to cast the current syntax node to UnderscorePrivateAttributeArgumentsSyntax
.
func `as`(_ syntaxType: DynamicReplacementAttributeArgumentsSyntax.Type) -> DynamicReplacementAttributeArgumentsSyntax?
Attempts to cast the current syntax node to DynamicReplacementAttributeArgumentsSyntax
.
func `as`(_ syntaxType: OpaqueReturnTypeOfAttributeArgumentsSyntax.Type) -> OpaqueReturnTypeOfAttributeArgumentsSyntax?
Attempts to cast the current syntax node to OpaqueReturnTypeOfAttributeArgumentsSyntax
.
func `as`(_ syntaxType: OriginallyDefinedInAttributeArgumentsSyntax.Type) -> OriginallyDefinedInAttributeArgumentsSyntax?
Attempts to cast the current syntax node to OriginallyDefinedInAttributeArgumentsSyntax
.
func `as`(_ syntaxType: UnavailableFromAsyncAttributeArgumentsSyntax.Type) -> UnavailableFromAsyncAttributeArgumentsSyntax?
Attempts to cast the current syntax node to UnavailableFromAsyncAttributeArgumentsSyntax
.
func `as`(_ syntaxType: ObjCSelectorPieceListSyntax.Type) -> ObjCSelectorPieceListSyntax?
Attempts to cast the current syntax node to ObjCSelectorPieceListSyntax
.
func `as`(_ syntaxType: ConventionWitnessMethodAttributeArgumentsSyntax.Type) -> ConventionWitnessMethodAttributeArgumentsSyntax?
Attempts to cast the current syntax node to ConventionWitnessMethodAttributeArgumentsSyntax
.
func `as`(_ syntaxType: AvailabilityArgumentListSyntax.Type) -> AvailabilityArgumentListSyntax?
Attempts to cast the current syntax node to AvailabilityArgumentListSyntax
.
func `as`(_ syntaxType: TokenSyntax.Type) -> TokenSyntax?
Attempts to cast the current syntax node to TokenSyntax
.
func `as`(_ syntaxType: ExposeAttributeArgumentsSyntax.Type) -> ExposeAttributeArgumentsSyntax?
Attempts to cast the current syntax node to ExposeAttributeArgumentsSyntax
.
func `as`(_ syntaxType: EffectsAttributeArgumentListSyntax.Type) -> EffectsAttributeArgumentListSyntax?
Attempts to cast the current syntax node to EffectsAttributeArgumentListSyntax
.
func cast(_ syntaxType: ConventionAttributeArgumentsSyntax.Type) -> ConventionAttributeArgumentsSyntax
Force-casts the current syntax node to ConventionAttributeArgumentsSyntax
.
func cast(_ syntaxType: DerivativeAttributeArgumentsSyntax.Type) -> DerivativeAttributeArgumentsSyntax
Force-casts the current syntax node to DerivativeAttributeArgumentsSyntax
.
func cast(_ syntaxType: ImplementsAttributeArgumentsSyntax.Type) -> ImplementsAttributeArgumentsSyntax
Force-casts the current syntax node to ImplementsAttributeArgumentsSyntax
.
func cast(_ syntaxType: SpecializeAttributeArgumentListSyntax.Type) -> SpecializeAttributeArgumentListSyntax
Force-casts the current syntax node to SpecializeAttributeArgumentListSyntax
.
func cast(_ syntaxType: BackDeployedAttributeArgumentsSyntax.Type) -> BackDeployedAttributeArgumentsSyntax
Force-casts the current syntax node to BackDeployedAttributeArgumentsSyntax
.
func cast(_ syntaxType: DocumentationAttributeArgumentListSyntax.Type) -> DocumentationAttributeArgumentListSyntax
Force-casts the current syntax node to DocumentationAttributeArgumentListSyntax
.
func cast(_ syntaxType: DifferentiableAttributeArgumentsSyntax.Type) -> DifferentiableAttributeArgumentsSyntax
Force-casts the current syntax node to DifferentiableAttributeArgumentsSyntax
.
func cast(_ syntaxType: LabeledExprListSyntax.Type) -> LabeledExprListSyntax
Force-casts the current syntax node to LabeledExprListSyntax
.
func cast(_ syntaxType: StringLiteralExprSyntax.Type) -> StringLiteralExprSyntax
Force-casts the current syntax node to StringLiteralExprSyntax
.
func cast(_ syntaxType: UnderscorePrivateAttributeArgumentsSyntax.Type) -> UnderscorePrivateAttributeArgumentsSyntax
Force-casts the current syntax node to UnderscorePrivateAttributeArgumentsSyntax
.
func cast(_ syntaxType: DynamicReplacementAttributeArgumentsSyntax.Type) -> DynamicReplacementAttributeArgumentsSyntax
Force-casts the current syntax node to DynamicReplacementAttributeArgumentsSyntax
.
func cast(_ syntaxType: OpaqueReturnTypeOfAttributeArgumentsSyntax.Type) -> OpaqueReturnTypeOfAttributeArgumentsSyntax
Force-casts the current syntax node to OpaqueReturnTypeOfAttributeArgumentsSyntax
.
func cast(_ syntaxType: OriginallyDefinedInAttributeArgumentsSyntax.Type) -> OriginallyDefinedInAttributeArgumentsSyntax
Force-casts the current syntax node to OriginallyDefinedInAttributeArgumentsSyntax
.
func cast(_ syntaxType: UnavailableFromAsyncAttributeArgumentsSyntax.Type) -> UnavailableFromAsyncAttributeArgumentsSyntax
Force-casts the current syntax node to UnavailableFromAsyncAttributeArgumentsSyntax
.
func cast(_ syntaxType: ObjCSelectorPieceListSyntax.Type) -> ObjCSelectorPieceListSyntax
Force-casts the current syntax node to ObjCSelectorPieceListSyntax
.
func cast(_ syntaxType: ConventionWitnessMethodAttributeArgumentsSyntax.Type) -> ConventionWitnessMethodAttributeArgumentsSyntax
Force-casts the current syntax node to ConventionWitnessMethodAttributeArgumentsSyntax
.
func cast(_ syntaxType: AvailabilityArgumentListSyntax.Type) -> AvailabilityArgumentListSyntax
Force-casts the current syntax node to AvailabilityArgumentListSyntax
.
func cast(_ syntaxType: TokenSyntax.Type) -> TokenSyntax
Force-casts the current syntax node to TokenSyntax
.
func cast(_ syntaxType: ExposeAttributeArgumentsSyntax.Type) -> ExposeAttributeArgumentsSyntax
Force-casts the current syntax node to ExposeAttributeArgumentsSyntax
.
func cast(_ syntaxType: EffectsAttributeArgumentListSyntax.Type) -> EffectsAttributeArgumentListSyntax
Force-casts the current syntax node to EffectsAttributeArgumentListSyntax
.
func `is`(_ syntaxType: ConventionAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to ConventionAttributeArgumentsSyntax
.
func `is`(_ syntaxType: DerivativeAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to DerivativeAttributeArgumentsSyntax
.
func `is`(_ syntaxType: ImplementsAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to ImplementsAttributeArgumentsSyntax
.
func `is`(_ syntaxType: SpecializeAttributeArgumentListSyntax.Type) -> Bool
Checks if the current syntax node can be cast to SpecializeAttributeArgumentListSyntax
.
func `is`(_ syntaxType: BackDeployedAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to BackDeployedAttributeArgumentsSyntax
.
func `is`(_ syntaxType: DocumentationAttributeArgumentListSyntax.Type) -> Bool
Checks if the current syntax node can be cast to DocumentationAttributeArgumentListSyntax
.
func `is`(_ syntaxType: DifferentiableAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to DifferentiableAttributeArgumentsSyntax
.
func `is`(_ syntaxType: LabeledExprListSyntax.Type) -> Bool
Checks if the current syntax node can be cast to LabeledExprListSyntax
.
func `is`(_ syntaxType: StringLiteralExprSyntax.Type) -> Bool
Checks if the current syntax node can be cast to StringLiteralExprSyntax
.
func `is`(_ syntaxType: UnderscorePrivateAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to UnderscorePrivateAttributeArgumentsSyntax
.
func `is`(_ syntaxType: DynamicReplacementAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to DynamicReplacementAttributeArgumentsSyntax
.
func `is`(_ syntaxType: OpaqueReturnTypeOfAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to OpaqueReturnTypeOfAttributeArgumentsSyntax
.
func `is`(_ syntaxType: OriginallyDefinedInAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to OriginallyDefinedInAttributeArgumentsSyntax
.
func `is`(_ syntaxType: UnavailableFromAsyncAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to UnavailableFromAsyncAttributeArgumentsSyntax
.
func `is`(_ syntaxType: ObjCSelectorPieceListSyntax.Type) -> Bool
Checks if the current syntax node can be cast to ObjCSelectorPieceListSyntax
.
func `is`(_ syntaxType: ConventionWitnessMethodAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to ConventionWitnessMethodAttributeArgumentsSyntax
.
func `is`(_ syntaxType: AvailabilityArgumentListSyntax.Type) -> Bool
Checks if the current syntax node can be cast to AvailabilityArgumentListSyntax
.
func `is`(_ syntaxType: TokenSyntax.Type) -> Bool
Checks if the current syntax node can be cast to TokenSyntax
.
func `is`(_ syntaxType: ExposeAttributeArgumentsSyntax.Type) -> Bool
Checks if the current syntax node can be cast to ExposeAttributeArgumentsSyntax
.
func `is`(_ syntaxType: EffectsAttributeArgumentListSyntax.Type) -> Bool
Checks if the current syntax node can be cast to EffectsAttributeArgumentListSyntax
.
init?<S>(_ node: S?) where S : SyntaxProtocol
Initializes a new instance of the conforming type from a given specialized syntax node.
var customMirror: Mirror { get }
var debugDescription: String { get }
A simple description of this node (ie. its type).
var description: String { get }
A source-accurate description of this node.
var detached: Self { get }
Return this subtree with this node as the root, ie. detach this node from its parent.
var endPosition: AbsolutePosition { get }
The end position of this node, including its trivia.
var endPositionBeforeTrailingTrivia: AbsolutePosition { get }
The end position of this node’s content, before any trailing trivia.
var hasError: Bool { get }
Whether the tree contained by this layout has any
var hasMaximumNestingLevelOverflow: Bool { get }
var hasParent: Bool { get }
Whether or not this node has a parent.
var hasSequenceExpr: Bool { get }
Whether this tree contains a missing token or unexpected node.
var hasWarning: Bool { get }
Whether the tree contained by this layout has any tokens with a TokenDiagnostic
of severity warning
.
var id: SyntaxIdentifier { get }
Returns a value representing the unique identity of the node.
var keyPathInParent: AnyKeyPath? { get }
var kind: SyntaxKind { get }
The kind of the syntax node, e.g. if it is a functionDecl
.
var leadingTrivia: Trivia { get set }
The leading trivia of this syntax node.
var leadingTriviaLength: SourceLength { get }
The length this node’s leading trivia takes up spelled out in source.
var parent: Syntax? { get }
The parent of this syntax node, or nil
if this node is the root.
var position: AbsolutePosition { get }
The absolute position of the starting point of this node. If the first token is with leading trivia, the position points to the start of the leading trivia.
var positionAfterSkippingLeadingTrivia: AbsolutePosition { get }
The absolute position of the starting point of this node, skipping any leading trivia attached to the first token syntax.
var raw: RawSyntax { get }
var root: Syntax { get }
The root of the tree in which this node resides.
var syntaxNodeType: SyntaxProtocol.Type { get }
The dynamic metatype of the concrete node.
var syntaxTextBytes: [UInt8] { get }
Retrieve the syntax text as an array of bytes that models the input source even in the presence of invalid UTF-8.
var totalByteRange: ByteSourceRange { get }
The byte source range of this node including leading and trailing trivia.
var totalLength: SourceLength { get }
The length of this node including all of its trivia.
var trailingTrivia: Trivia { get set }
The trailing trivia of this syntax node.
var trailingTriviaLength: SourceLength { get }
The length this node’s trailing trivia takes up spelled out in source.
var trimmed: Self { get }
A copy of this node without the leading trivia of the first token in the node and the trailing trivia of the last token in the node.
var trimmedByteRange: ByteSourceRange { get }
The byte source range of this node excluding leading and trailing trivia.
var trimmedDescription: String { get }
The description of this node with leading whitespace of the first token and trailing whitespace of the last token removed.
var trimmedLength: SourceLength { get }
The length this node takes up spelled out in the source, excluding its leading or trailing trivia.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
static func == (lhs: Self, rhs: Self) -> Bool
func `as`<S>(_ syntaxType: S.Type) -> S? where S : SyntaxProtocol
Attempts to cast the current syntax node to a given specialized syntax type.
func asProtocol(_: MissingNodeSyntax.Protocol) -> MissingNodeSyntax?
Return the non-type erased version of this syntax node if it conforms to MissingNodeSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: ParenthesizedSyntax.Protocol) -> ParenthesizedSyntax?
Return the non-type erased version of this syntax node if it conforms to ParenthesizedSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithCodeBlockSyntax.Protocol) -> WithCodeBlockSyntax?
Return the non-type erased version of this syntax node if it conforms to WithCodeBlockSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithModifiersSyntax.Protocol) -> WithModifiersSyntax?
Return the non-type erased version of this syntax node if it conforms to WithModifiersSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithAttributesSyntax.Protocol) -> WithAttributesSyntax?
Return the non-type erased version of this syntax node if it conforms to WithAttributesSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithStatementsSyntax.Protocol) -> WithStatementsSyntax?
Return the non-type erased version of this syntax node if it conforms to WithStatementsSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: EffectSpecifiersSyntax.Protocol) -> EffectSpecifiersSyntax?
Return the non-type erased version of this syntax node if it conforms to EffectSpecifiersSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithTrailingCommaSyntax.Protocol) -> WithTrailingCommaSyntax?
Return the non-type erased version of this syntax node if it conforms to WithTrailingCommaSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithGenericParametersSyntax.Protocol) -> WithGenericParametersSyntax?
Return the non-type erased version of this syntax node if it conforms to WithGenericParametersSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: WithOptionalCodeBlockSyntax.Protocol) -> WithOptionalCodeBlockSyntax?
Return the non-type erased version of this syntax node if it conforms to WithOptionalCodeBlockSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: FreestandingMacroExpansionSyntax.Protocol) -> FreestandingMacroExpansionSyntax?
Return the non-type erased version of this syntax node if it conforms to FreestandingMacroExpansionSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: BracedSyntax.Protocol) -> BracedSyntax?
Return the non-type erased version of this syntax node if it conforms to BracedSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: DeclGroupSyntax.Protocol) -> DeclGroupSyntax?
Return the non-type erased version of this syntax node if it conforms to DeclGroupSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func asProtocol(_: NamedDeclSyntax.Protocol) -> NamedDeclSyntax?
Return the non-type erased version of this syntax node if it conforms to NamedDeclSyntax
. Otherwise return nil
. Note that this will incur an existential conversion.
func cast<S>(_ syntaxType: S.Type) -> S where S : SyntaxProtocol
Force-casts the current syntax node to a given specialized syntax type.
func children(viewMode: SyntaxTreeViewMode) -> SyntaxChildren
A sequence over the children of this node.
func debugDescription(includeTrivia: Bool = false, converter: SourceLocationConverter? = nil, mark: SyntaxProtocol? = nil, indentString: String = "") -> String
Returns a summarized dump of this node.
func endLocation(converter: SourceLocationConverter, afterTrailingTrivia: Bool = false) -> SourceLocation
The ending location, in the provided file, of this Syntax node.
func firstToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Returns the first token node that is part of this syntax node.
func hash(into hasher: inout Hasher)
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : SyntaxProtocol
Checks if the current syntax node can be cast to a given specialized syntax type.
func isProtocol(_: MissingNodeSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to MissingNodeSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: ParenthesizedSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to ParenthesizedSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithCodeBlockSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithCodeBlockSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithModifiersSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithModifiersSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithAttributesSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithAttributesSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithStatementsSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithStatementsSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: EffectSpecifiersSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to EffectSpecifiersSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithTrailingCommaSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithTrailingCommaSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithGenericParametersSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithGenericParametersSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: WithOptionalCodeBlockSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to WithOptionalCodeBlockSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: FreestandingMacroExpansionSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to FreestandingMacroExpansionSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: BracedSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to BracedSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: DeclGroupSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to DeclGroupSyntax
. Note that this will incur an existential conversion.
func isProtocol(_: NamedDeclSyntax.Protocol) -> Bool
Check whether the non-type erased version of this syntax node conforms to NamedDeclSyntax
. Note that this will incur an existential conversion.
func lastToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Returns the last token node that is part of this syntax node.
func nextToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Recursively walks through the tree to find the next token semantically after this node.
func node(at syntaxIdentifier: SyntaxIdentifier) -> Syntax?
If the node with the given syntaxIdentifier
is a (recursive) child of this node, return the node with that identifier.
func previousToken(viewMode: SyntaxTreeViewMode) -> TokenSyntax?
Recursively walks through the tree to find the token semantically before this node.
func sourceRange(converter: SourceLocationConverter, afterLeadingTrivia: Bool = true, afterTrailingTrivia: Bool = false) -> SourceRange
The source range, in the provided file, of this Syntax node.
func startLocation(converter: SourceLocationConverter, afterLeadingTrivia: Bool = true) -> SourceLocation
The starting location, in the provided file, of this Syntax node.
func token(at position: AbsolutePosition) -> TokenSyntax?
Find the syntax token at the given absolute position within this syntax node or any of its children.
func tokens(viewMode: SyntaxTreeViewMode) -> TokenSequence
Sequence of tokens that are part of this Syntax node.
func trimmed(matching filter: (TriviaPiece) -> Bool) -> Self
A copy of this node with pieces that match matching
trimmed from the leading trivia of the first token and trailing trivia of the last token.
func trimmedDescription(matching filter: (TriviaPiece) -> Bool) -> String
The description of this node with pieces that match matching
removed from the leading trivia of the first token and trailing trivia of the last token.
func with<T>(_ keyPath: WritableKeyPath<Self, T>, _ value: T) -> Self
Returns a new syntax node that has the child at keyPath
replaced by value
.
func write<Target>(to target: inout Target) where Target : TextOutputStream
Prints the raw value of this node to the provided stream.
var byteRange: ByteSourceRange { get }
var byteSize: Int { get }
The textual byte length of this node including leading and trailing trivia.
var byteSizeAfterTrimmingTrivia: Int { get }
The textual byte length of this node excluding leading and trailing trivia.
var contentLength: SourceLength { get }
var firstToken: TokenSyntax? { get }
var index: SyntaxChildrenIndex { get }
The index of this node in a SyntaxChildren
collection.
var isImplicit: Bool { get }
When isImplicit is true, the syntax node doesn’t include any underlying tokens, e.g. an empty CodeBlockItemList.
var lastToken: TokenSyntax? { get }
var nextToken: TokenSyntax? { get }
var previousToken: TokenSyntax? { get }
func `as`<S>(_ syntaxType: S.Type) -> S? where S : SyntaxProtocol
Attempts to cast the current SyntaxChildChoices
instance to a given specialized syntax type.
func `as`(_ syntaxType: Syntax.Type) -> Syntax?
Attempts to upcast the current syntax node to Syntax
node.
func `as`(_ syntaxType: Self.Type) -> Self?
Casts the current syntax node to its own type.
func cast<S>(_ syntaxType: S.Type) -> S where S : SyntaxProtocol
Force-casts the current SyntaxChildChoices
instance to a given specialized syntax type.
func cast(_ syntaxType: Syntax.Type) -> Syntax
Force-cast the current syntax node to Syntax
node..
func cast(_ syntaxType: Self.Type) -> Self
Force-casts the current syntax node to its own type.
func detach() -> Self
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : SyntaxProtocol
Checks if the current SyntaxChildChoices
instance can be cast to a given specialized syntax type.
func `is`(_ syntaxType: Syntax.Type) -> Bool
Checks if the current syntax node can be upcast to Syntax
node.
func `is`(_ syntaxType: Self.Type) -> Bool
Checks if the current syntax node can be cast to its own type.