PatternSyntaxProtocol
Protocol to which all PatternSyntax
nodes conform.
protocol PatternSyntaxProtocol : SyntaxProtocol
Browse conforming typesExtension point to add common methods to all PatternSyntax
nodes.
Protocol to which all PatternSyntax
nodes conform.
protocol PatternSyntaxProtocol : SyntaxProtocol
Extension point to add common methods to all PatternSyntax
nodes.
import SwiftSyntax
A library for working with Swift code.
struct PatternSyntax
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 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 Sendable
protocol TextOutputStreamable
A source of text-streaming operations.
struct MissingPatternSyntax
In case the source code is missing a pattern, this node stands in place of the missing pattern.
struct ExpressionPatternSyntax
A pattern that contains an ExprSyntaxProtocol
.
struct IdentifierPatternSyntax
A pattern that contains a TokenSyntax
.
struct IsTypePatternSyntax
struct TuplePatternSyntax
A pattern that contains a list of other pattern.
struct ValueBindingPatternSyntax
struct WildcardPatternSyntax
A pattern that represent a wildcard.
func `as`<S>(_ syntaxType: S.Type) -> S? where S : PatternSyntaxProtocol
Attempts to cast the current syntax node to a given specialized syntax type.
func cast<S>(_ syntaxType: S.Type) -> S where S : PatternSyntaxProtocol
Force-casts the current syntax node to a given specialized syntax type.
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : PatternSyntaxProtocol
Checks if the current syntax node can be cast to a given specialized syntax type.
func `as`(_ syntaxType: PatternSyntax.Type) -> PatternSyntax?
Attempts to upcast the current syntax node to its base node type (PatternSyntax
).
func `as`<S>(_ syntaxType: S.Type) -> S? where S : SyntaxProtocol
Attempts to cast the current syntax node to a given node type from the a base node protocol hierarchy other than PatternSyntaxProtocol
.
func cast(_ syntaxType: PatternSyntax.Type) -> PatternSyntax
Force-upcast the current syntax node to its base node type (PatternSyntax
).
func cast<S>(_ syntaxType: S.Type) -> S where S : SyntaxProtocol
Force-casts the current syntax node to a given node type from a base node protocol hierarchy other than PatternSyntaxProtocol
.
func `is`(_ syntaxType: PatternSyntax.Type) -> Bool
Checks if the current syntax node can be upcast to its base node type (PatternSyntax
).
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : SyntaxProtocol
Checks if the current syntax node can be cast to a given node type from a base node protocol hierarchy other than PatternSyntaxProtocol
.
protocol _LeafPatternSyntaxNodeProtocol : PatternSyntaxProtocol
Protocol that syntax nodes conform to if they don’t have any semantic subtypes. These are syntax nodes that are not considered base nodes for other syntax types.