StmtSyntaxProtocol
Protocol to which all StmtSyntax
nodes conform.
protocol StmtSyntaxProtocol : SyntaxProtocol
Browse conforming typesExtension point to add common methods to all StmtSyntax
nodes.
Protocol to which all StmtSyntax
nodes conform.
protocol StmtSyntaxProtocol : SyntaxProtocol
Extension point to add common methods to all StmtSyntax
nodes.
import SwiftSyntax
A library for working with Swift code.
struct StmtSyntax
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 MissingStmtSyntax
In case the source code is missing a statement, this node stands in place of the missing statement.
struct BreakStmtSyntax
struct ContinueStmtSyntax
struct DeferStmtSyntax
struct DiscardStmtSyntax
struct DoStmtSyntax
struct ExpressionStmtSyntax
struct FallThroughStmtSyntax
struct ForStmtSyntax
struct GuardStmtSyntax
struct LabeledStmtSyntax
struct RepeatStmtSyntax
struct ReturnStmtSyntax
struct ThrowStmtSyntax
struct WhileStmtSyntax
struct YieldStmtSyntax
func `as`<S>(_ syntaxType: S.Type) -> S? where S : StmtSyntaxProtocol
Attempts to cast the current syntax node to a given specialized syntax type.
func cast<S>(_ syntaxType: S.Type) -> S where S : StmtSyntaxProtocol
Force-casts the current syntax node to a given specialized syntax type.
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : StmtSyntaxProtocol
Checks if the current syntax node can be cast to a given specialized syntax type.
func `as`(_ syntaxType: StmtSyntax.Type) -> StmtSyntax?
Attempts to upcast the current syntax node to its base node type (StmtSyntax
).
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 StmtSyntaxProtocol
.
func cast(_ syntaxType: StmtSyntax.Type) -> StmtSyntax
Force-upcast the current syntax node to its base node type (StmtSyntax
).
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 StmtSyntaxProtocol
.
func `is`(_ syntaxType: StmtSyntax.Type) -> Bool
Checks if the current syntax node can be upcast to its base node type (StmtSyntax
).
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 StmtSyntaxProtocol
.
protocol _LeafStmtSyntaxNodeProtocol : StmtSyntaxProtocol
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.