Library Moduleswift-syntax 510.0.3SwiftSyntax
SwiftSyntax
A library for working with Swift code.
SwiftSyntax.mdimport SwiftSyntax
Module information
- Declarations
- 11489
- Symbols
- 48707
Overview
SwiftSyntax is a source accurate tree representation of Swift source code. It allows Swift tools to parse, inspect, generate, and transform Swift source code.
Articles
Working with SwiftSyntax
Learn the basics of working with Swift source code with the SwiftSyntax library.
Read MoreUpdating a Macro to a New Major swift-syntax Version
Guidance of how to version macros when a new major swift-syntax version is released.
Read MoreGlossary
Glossary of terms and abbreviations used in SwiftSyntax
Read More
Tutorials
Introduction to SwiftSyntax
SwiftSyntax provides the foundation for tools that inspect, manipulate, and transform Swift source code.
Read More
Contributing
These articles are intended for developers wishing to contribute to SwiftSyntax
Changing Syntax Nodes
Discover the steps necessary to add, remove, and update syntax nodes
Read MoreWhen to use protocols in SwiftSyntax
Learn when to use protocols value types like
Read MoreExprSyntax
over protocols likeExprSyntaxProtocol
.@_spi attribute
Learn when SwiftSyntax exposes declaration annotated as
Read More@_spi
.Language Features Usable in swift-syntax
Defines which language features the swift-syntax package can use.
Read More
Syntax
struct Syntax
A Syntax node represents a tree of nodes with tokens at the leaves. Each node has accessors for its known children, and allows efficient iteration over the children through its
children
property.protocol SyntaxCollection
Trivia
struct Trivia
Trivia represent pieces of the source code that are not relevant to represent its semantic structure.
enum TriviaPiece
A contiguous stretch of a single kind of trivia. The constituent part of a
Trivia
collection.enum TriviaPosition
Tokens
struct TokenSyntax
A Syntax node representing a single token.
enum TokenKind
Enumerates the kinds of tokens in the Swift language.
struct TokenSequence
Sequence of tokens that are part of the provided Syntax node.
enum SourcePresence
An indicator of whether a Syntax node was found or written in the source.
Syntax Visitors
class SyntaxVisitor
class SyntaxAnyVisitor
A
SyntaxVisitor
that can visit the nodes as genericSyntax
values.class SyntaxRewriter
/ Automatically generated by generate-swift-syntax / Do not edit directly!
enum SyntaxTreeViewMode
Specifies how missing and unexpected nodes should be handled when traversing a syntax tree.
enum SyntaxVisitorContinueKind
The enum describes how the
SyntaxVisitor
should continue after visiting the current node.struct ReversedTokenSequence
Reverse sequence of tokens that are part of the provided Syntax node.
Declarations
struct DeclSyntax
protocol DeclSyntaxProtocol
Protocol to which all
DeclSyntax
nodes conform.struct MissingDeclSyntax
In case the source code is missing a declaration, this node stands in place of the missing declaration.
struct AccessorDeclSyntax
struct ActorDeclSyntax
struct AssociatedTypeDeclSyntax
An
associatedtype
declarationstruct ClassDeclSyntax
A
class
declarationstruct DeinitializerDeclSyntax
A
deint
declarationstruct EditorPlaceholderDeclSyntax
An editor placeholder, e.g.
<#declaration#>
that is used in a position that expects a declaration.struct EnumCaseDeclSyntax
A
case
declaration of a Swiftenum
. It can have 1 or moreEnumCaseElement
s inside, each declaring a different case of the enum.struct EnumDeclSyntax
A Swift
enum
declaration.struct ExtensionDeclSyntax
struct FunctionDeclSyntax
struct IfConfigDeclSyntax
struct ImportDeclSyntax
An
import
declarationstruct InitializerDeclSyntax
An
init
declarationstruct MacroDeclSyntax
struct MacroExpansionDeclSyntax
struct OperatorDeclSyntax
A Swift
operator
declaration.struct PoundSourceLocationSyntax
struct PrecedenceGroupDeclSyntax
A Swift
precedencegroup
declaration.struct ProtocolDeclSyntax
A
protocol
declarationstruct StructDeclSyntax
A
struct
declarationstruct SubscriptDeclSyntax
struct TypeAliasDeclSyntax
struct VariableDeclSyntax
Declaration of one or more variables
Expressions
struct ExprSyntax
protocol ExprSyntaxProtocol
Protocol to which all
ExprSyntax
nodes conform.struct MissingExprSyntax
In case the source code is missing an expression, this node stands in place of the missing expression.
struct ArrayExprSyntax
struct ArrowExprSyntax
struct AsExprSyntax
struct AssignmentExprSyntax
struct AwaitExprSyntax
struct BinaryOperatorExprSyntax
struct BooleanLiteralExprSyntax
struct BorrowExprSyntax
struct CanImportExprSyntax
struct CanImportVersionInfoSyntax
struct ClosureExprSyntax
struct ConsumeExprSyntax
struct CopyExprSyntax
struct DeclReferenceExprSyntax
struct DictionaryExprSyntax
struct DiscardAssignmentExprSyntax
struct EditorPlaceholderExprSyntax
struct FloatLiteralExprSyntax
struct ForceUnwrapExprSyntax
struct FunctionCallExprSyntax
struct GenericSpecializationExprSyntax
struct IfExprSyntax
struct InOutExprSyntax
struct InfixOperatorExprSyntax
struct IntegerLiteralExprSyntax
struct IsExprSyntax
Checks if an expression is of a given type.
struct KeyPathExprSyntax
struct MacroExpansionExprSyntax
struct MemberAccessExprSyntax
An expression that access a member like a function or a property.
struct NilLiteralExprSyntax
struct OptionalChainingExprSyntax
struct PackElementExprSyntax
struct PackExpansionExprSyntax
struct PatternExprSyntax
struct PostfixIfConfigExprSyntax
struct PostfixOperatorExprSyntax
struct PrefixOperatorExprSyntax
struct RegexLiteralExprSyntax
struct SequenceExprSyntax
struct SimpleStringLiteralExprSyntax
A simple string that can’t contain string interpolation and cannot have raw string delimiters.
struct StringLiteralExprSyntax
struct SubscriptCallExprSyntax
struct SuperExprSyntax
struct SwitchExprSyntax
struct TernaryExprSyntax
struct TryExprSyntax
struct TupleExprSyntax
struct TypeExprSyntax
struct UnresolvedAsExprSyntax
struct UnresolvedIsExprSyntax
struct UnresolvedTernaryExprSyntax
Patterns
struct PatternSyntax
protocol PatternSyntaxProtocol
Protocol to which all
PatternSyntax
nodes conform.struct MissingPatternSyntax
In case the source code is missing a pattern, this node stands in place of the missing pattern.
struct ExpressionPatternSyntax
struct IdentifierPatternSyntax
struct IsTypePatternSyntax
struct TuplePatternSyntax
struct ValueBindingPatternSyntax
struct WildcardPatternSyntax
Statements
struct StmtSyntax
protocol StmtSyntaxProtocol
Protocol to which all
StmtSyntax
nodes conform.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 ThenStmtSyntax
A statement used to indicate the produced value from an if/switch expression.
struct ThrowStmtSyntax
struct WhileStmtSyntax
struct YieldStmtSyntax
Types
struct TypeSyntax
protocol TypeSyntaxProtocol
Protocol to which all
TypeSyntax
nodes conform.struct MissingTypeSyntax
In case the source code is missing a type, this node stands in place of the missing type.
struct ArrayTypeSyntax
struct AttributedTypeSyntax
struct ClassRestrictionTypeSyntax
struct CompositionTypeSyntax
struct DictionaryTypeSyntax
struct FunctionTypeSyntax
struct IdentifierTypeSyntax
struct ImplicitlyUnwrappedOptionalTypeSyntax
struct MemberTypeSyntax
struct MetatypeTypeSyntax
struct NamedOpaqueReturnTypeSyntax
struct OptionalTypeSyntax
struct PackElementTypeSyntax
struct PackExpansionTypeSyntax
struct SomeOrAnyTypeSyntax
struct SuppressedTypeSyntax
struct TupleTypeSyntax
Collections
struct SyntaxChildren
Collection that contains the present child
Syntax
nodes of the given node.struct SyntaxChildrenIndex
An index in a syntax children collection.
struct AccessorDeclListSyntax
struct ArrayElementListSyntax
struct ArrayElementSyntax
struct AttributeListSyntax
A list of attributes that can be attached to a declaration.
struct AttributeSyntax
An
@
attribute.struct AvailabilityArgumentListSyntax
struct AvailabilityArgumentSyntax
A single argument to an
@available
argument like*
,iOS 10.1
, ormessage: "This has been deprecated"
.struct CatchClauseListSyntax
struct CatchClauseSyntax
struct CatchItemListSyntax
struct CatchItemSyntax
struct ClosureCaptureListSyntax
struct ClosureCaptureSyntax
struct ClosureParameterListSyntax
struct ClosureParameterSyntax
struct ClosureShorthandParameterListSyntax
struct ClosureShorthandParameterSyntax
struct CodeBlockItemListSyntax
struct CodeBlockItemSyntax
A CodeBlockItem is any Syntax node that appears on its own line inside a CodeBlock.
struct CompositionTypeElementListSyntax
struct CompositionTypeElementSyntax
struct ConditionElementListSyntax
struct ConditionElementSyntax
struct DeclModifierListSyntax
struct DeclModifierSyntax
struct DeclNameArgumentListSyntax
struct DeclNameArgumentSyntax
struct DesignatedTypeListSyntax
struct DesignatedTypeSyntax
struct DictionaryElementListSyntax
struct DictionaryElementSyntax
struct DifferentiabilityArgumentListSyntax
struct DifferentiabilityArgumentSyntax
A differentiability argument: either the “self” identifier, a function parameter name, or a function parameter index.
struct DocumentationAttributeArgumentListSyntax
The arguments of the ‘@_documentation’ attribute
struct DocumentationAttributeArgumentSyntax
struct EffectsAttributeArgumentListSyntax
The arguments of the ‘@_effects’ attribute. These will be parsed during the SIL stage.
struct EnumCaseElementListSyntax
A collection of 0 or more
EnumCaseElement
s.struct EnumCaseElementSyntax
An element of an enum case, containing the name of the case and, optionally, either associated values or an assignment to a raw value.
struct EnumCaseParameterListSyntax
struct EnumCaseParameterSyntax
struct ExprListSyntax
A list of expressions connected by operators. This list is contained by a
SequenceExprSyntax
.struct FunctionParameterListSyntax
struct FunctionParameterSyntax
struct GenericArgumentListSyntax
struct GenericArgumentSyntax
struct GenericParameterListSyntax
struct GenericParameterSyntax
struct GenericRequirementListSyntax
struct GenericRequirementSyntax
struct IfConfigClauseListSyntax
struct IfConfigClauseSyntax
struct ImportPathComponentListSyntax
struct ImportPathComponentSyntax
struct InheritedTypeListSyntax
struct InheritedTypeSyntax
struct KeyPathComponentListSyntax
struct KeyPathComponentSyntax
struct LabeledExprListSyntax
struct LabeledExprSyntax
struct MemberBlockItemListSyntax
struct MemberBlockItemSyntax
A member declaration of a type consisting of a declaration and an optional semicolon;
struct MultipleTrailingClosureElementListSyntax
struct MultipleTrailingClosureElementSyntax
struct ObjCSelectorPieceListSyntax
struct ObjCSelectorPieceSyntax
A piece of an Objective-C selector. Either consisting of just an identifier for a nullary selector, an identifier and a colon for a labeled argument or just a colon for an unlabeled argument
struct PatternBindingListSyntax
struct PatternBindingSyntax
Defines variables inside a variable declaration.
struct PlatformVersionItemListSyntax
struct PlatformVersionItemSyntax
A single platform/version pair in an attribute, e.g.
iOS 10.1
.struct PrecedenceGroupAttributeListSyntax
struct PrecedenceGroupRelationSyntax
Specify the new precedence group’s relation to existing precedence groups.
struct PrecedenceGroupAssignmentSyntax
Specifies the precedence of an operator when used in an operation that includes optional chaining.
struct PrecedenceGroupAssociativitySyntax
Specifies how a sequence of operators with the same precedence level are grouped together in the absence of grouping parentheses.
struct PrecedenceGroupNameListSyntax
struct PrecedenceGroupNameSyntax
struct PrimaryAssociatedTypeListSyntax
struct PrimaryAssociatedTypeSyntax
struct SimpleStringLiteralSegmentListSyntax
String literal segments that only can contain non string interpolated or extended escaped strings
struct StringSegmentSyntax
struct SpecializeAttributeArgumentListSyntax
A collection of arguments for the
@_specialize
attributestruct LabeledSpecializeArgumentSyntax
A labeled argument for the
@_specialize
attribute likeexported: true
struct SpecializeAvailabilityArgumentSyntax
The availability argument for the _specialize attribute
struct SpecializeTargetFunctionArgumentSyntax
A labeled argument for the
@_specialize
attribute with a function decl value liketarget: myFunc(_:)
struct GenericWhereClauseSyntax
A
where
clause that places additional constraints on generic parameters likewhere Element: Hashable
.struct StringLiteralSegmentListSyntax
struct StringSegmentSyntax
struct ExpressionSegmentSyntax
struct SwitchCaseItemListSyntax
struct SwitchCaseItemSyntax
struct SwitchCaseListSyntax
struct SwitchCaseSyntax
struct TuplePatternElementListSyntax
struct TuplePatternElementSyntax
struct TupleTypeElementListSyntax
struct TupleTypeElementSyntax
struct UnexpectedNodesSyntax
A collection of syntax nodes that occurred in the source code but could not be used to form a valid syntax tree.
struct VersionComponentListSyntax
struct VersionComponentSyntax
An element to represent a single component in a version, like
.1
.struct YieldedExpressionListSyntax
struct YieldedExpressionSyntax
Attributes
struct AttributeListSyntax
A list of attributes that can be attached to a declaration.
struct AttributeSyntax
An
@
attribute.struct BackDeployedAttributeArgumentsSyntax
A collection of arguments for the
@backDeployed
attributestruct ConventionAttributeArgumentsSyntax
The arguments for the ‘@convention(…)’.
struct ConventionWitnessMethodAttributeArgumentsSyntax
The arguments for the ‘@convention(witness_method: …)’.
struct DerivativeAttributeArgumentsSyntax
The arguments for the ‘@derivative(of:)’ and ‘@transpose(of:)’ attributes: the ‘of:’ label, the original declaration name, and an optional differentiability parameter list.
struct DifferentiabilityArgumentListSyntax
struct DifferentiabilityArgumentSyntax
A differentiability argument: either the “self” identifier, a function parameter name, or a function parameter index.
struct DifferentiabilityArgumentsSyntax
The differentiability arguments.
struct DifferentiabilityWithRespectToArgumentSyntax
A clause containing differentiability parameters.
struct DifferentiableAttributeArgumentsSyntax
The arguments for the
@differentiable
attribute: an optional differentiability kind, an optional differentiability parameter clause, and an optional ‘where’ clause.struct DocumentationAttributeArgumentListSyntax
The arguments of the ‘@_documentation’ attribute
struct DocumentationAttributeArgumentSyntax
struct DynamicReplacementAttributeArgumentsSyntax
The arguments for the ‘@_dynamicReplacement’ attribute
struct EffectsAttributeArgumentListSyntax
The arguments of the ‘@_effects’ attribute. These will be parsed during the SIL stage.
struct ExposeAttributeArgumentsSyntax
The arguments for the ‘@_expose’ attribute
struct ImplementsAttributeArgumentsSyntax
The arguments for the
@_implements
attribute of the formType, methodName(arg1Label:arg2Label:)
struct LabeledSpecializeArgumentSyntax
A labeled argument for the
@_specialize
attribute likeexported: true
struct ObjCSelectorPieceListSyntax
struct ObjCSelectorPieceSyntax
A piece of an Objective-C selector. Either consisting of just an identifier for a nullary selector, an identifier and a colon for a labeled argument or just a colon for an unlabeled argument
struct OpaqueReturnTypeOfAttributeArgumentsSyntax
The arguments for the ‘@_opaqueReturnTypeOf()’.
struct OriginallyDefinedInAttributeArgumentsSyntax
The arguments for the ‘@_originallyDefinedIn’ attribute
struct PlatformVersionItemListSyntax
struct PlatformVersionItemSyntax
A single platform/version pair in an attribute, e.g.
iOS 10.1
.struct SpecializeAttributeArgumentListSyntax
A collection of arguments for the
@_specialize
attributestruct SpecializeAvailabilityArgumentSyntax
The availability argument for the _specialize attribute
struct SpecializeTargetFunctionArgumentSyntax
A labeled argument for the
@_specialize
attribute with a function decl value liketarget: myFunc(_:)
struct UnavailableFromAsyncAttributeArgumentsSyntax
The arguments for the ‘@_unavailableFromAsync’ attribute
struct UnderscorePrivateAttributeArgumentsSyntax
The arguments for the ‘@_private’ attribute
Miscellaneous Syntax
struct AccessorBlockSyntax
struct AccessorEffectSpecifiersSyntax
struct AccessorParametersSyntax
struct AvailabilityConditionSyntax
struct AvailabilityLabeledArgumentSyntax
An argument to an
@available
attribute that consists of a label and a value, e.g.message: "This has been deprecated"
.struct ClosureCaptureClauseSyntax
struct ClosureCaptureSpecifierSyntax
struct ClosureParameterClauseSyntax
struct ClosureSignatureSyntax
struct CodeBlockSyntax
struct ConformanceRequirementSyntax
struct DeclModifierDetailSyntax
struct DeclNameArgumentsSyntax
struct DeinitializerEffectSpecifiersSyntax
struct EnumCaseParameterClauseSyntax
struct FunctionEffectSpecifiersSyntax
struct FunctionParameterClauseSyntax
struct FunctionSignatureSyntax
struct GenericArgumentClauseSyntax
struct GenericParameterClauseSyntax
The parameter clause that defines the generic parameters.
struct InheritanceClauseSyntax
struct InitializerClauseSyntax
struct KeyPathOptionalComponentSyntax
struct KeyPathPropertyComponentSyntax
struct KeyPathSubscriptComponentSyntax
struct LayoutRequirementSyntax
struct MatchingPatternConditionSyntax
struct MemberBlockSyntax
struct MissingSyntax
In case the source code is missing a syntax node, this node stands in place of the missing node.
struct OperatorPrecedenceAndTypesSyntax
A clause to specify precedence group in infix operator declarations, and designated types in any operator declaration.
struct OptionalBindingConditionSyntax
struct PlatformVersionSyntax
An argument to
@available
that restricts the availability on a certain platform to a version, e.g.iOS 10
orswift 3.4
.struct PoundSourceLocationArgumentsSyntax
struct PrimaryAssociatedTypeClauseSyntax
struct ReturnClauseSyntax
struct SameTypeRequirementSyntax
struct SourceFileSyntax
struct SwitchCaseLabelSyntax
struct SwitchDefaultLabelSyntax
struct TypeAnnotationSyntax
struct TypeEffectSpecifiersSyntax
struct TypeInitializerClauseSyntax
struct VersionTupleSyntax
A version number like
1.2.0
. Only the first version component is required. There might be an arbitrary number of following components.struct WhereClauseSyntax
struct YieldedExpressionsClauseSyntax
Traits
protocol BracedSyntax
/ Automatically generated by generate-swift-syntax / Do not edit directly!
protocol DeclGroupSyntax
protocol EffectSpecifiersSyntax
protocol FreestandingMacroExpansionSyntax
protocol NamedDeclSyntax
protocol MissingNodeSyntax
Represents a layout node that is missing in the source file.
protocol ParenthesizedSyntax
protocol WithAttributesSyntax
protocol WithCodeBlockSyntax
protocol WithGenericParametersSyntax
Syntax nodes that have generic parameters.
protocol WithModifiersSyntax
protocol WithStatementsSyntax
protocol WithTrailingCommaSyntax
Syntax Position
struct AbsolutePosition
An absolute position in a source file as text - the absolute utf8Offset from the start of the file.
struct ByteSourceRange
struct SourceLocation
Represents a source location in a Swift file.
class SourceLocationConverter
Converts
AbsolutePosition
s of syntax nodes toSourceLocation
s, and vice-versa. TheAbsolutePosition
s must be originating from nodes that are part of the same tree that was used to initialize this class.struct SourceRange
Represents a half-open range in a Swift file.
struct SourceLength
The length a syntax node spans in the source code. From any AbsolutePosition you reach a node’s end location by adding its UTF-8 length.
Internals
protocol SyntaxProtocol
Provide common functionality for specialized syntax nodes. Extend this protocol to provide common functionality for all syntax nodes.
class SyntaxArena
A syntax arena owns the memory for all syntax nodes within it.
enum SyntaxEnum
Enum to exhaustively switch over all different syntax nodes.
protocol SyntaxHashable
Protocol that provides a common Hashable implementation for all syntax nodes
struct SyntaxIdentifier
Provides a stable and unique identity for
Syntax
nodes.
Uncategorized
Protocols
protocol SyntaxChildChoices
Protocol for the enums nested inside
Syntax
nodes that enumerate all the possible types a child node might have.
Show implementation details (6)
Hide implementation details
protocol _LeafDeclSyntaxNodeProtocol
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.
protocol _LeafExprSyntaxNodeProtocol
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.
protocol _LeafPatternSyntaxNodeProtocol
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.
protocol _LeafStmtSyntaxNodeProtocol
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.
protocol _LeafSyntaxNodeProtocol
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.
protocol _LeafTypeSyntaxNodeProtocol
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.
Show system interfaces (7)
Hide system interfaces
protocol RawDeclSyntaxNodeProtocol
protocol RawExprSyntaxNodeProtocol
protocol RawPatternSyntaxNodeProtocol
protocol RawStmtSyntaxNodeProtocol
protocol RawSyntaxNodeProtocol
All typed raw syntax nodes conform to this protocol.
RawXXXSyntax
is a typed wrappeer ofRawSyntax
.protocol RawTypeSyntaxNodeProtocol
protocol SyntaxTransformVisitor
/ Automatically generated by generate-swift-syntax / Do not edit directly!
Types
struct IncrementalEdit
enum Keyword
/ Automatically generated by generate-swift-syntax / Do not edit directly!
class ParsingSyntaxArena
SyntaxArena for parsing.
struct SyntaxCollectionIterator<E>
An iterator over a
SyntaxCollection
.enum SyntaxKind
Enumerates the known kinds of Syntax represented in the Syntax tree.
enum SyntaxNodeStructure
Describes the statically allowed structure of a syntax tree node.
struct TokenDiagnostic
If the token has an error that’s inherent to the token itself and not its surrounding structure, this defines the type of the error.
byteOffset
specifies at which offset the error occurred.
Show system interfaces (291)
Hide system interfaces
class BumpPtrAllocator
A
BumpPtrAllocator
that allocatesslabSize
at a time. Once all memory in a slab has been used, it allocates a new slab and no memory allocations are necessary until that slab is completely filled up.struct RawAccessorBlockSyntax
struct RawAccessorDeclListSyntax
struct RawAccessorDeclSyntax
struct RawAccessorEffectSpecifiersSyntax
struct RawAccessorParametersSyntax
struct RawActorDeclSyntax
struct RawArrayElementListSyntax
struct RawArrayElementSyntax
struct RawArrayExprSyntax
struct RawArrayTypeSyntax
struct RawArrowExprSyntax
struct RawAsExprSyntax
struct RawAssignmentExprSyntax
struct RawAssociatedTypeDeclSyntax
struct RawAttributeListSyntax
struct RawAttributeSyntax
struct RawAttributedTypeSyntax
struct RawAvailabilityArgumentListSyntax
struct RawAvailabilityArgumentSyntax
struct RawAvailabilityConditionSyntax
struct RawAvailabilityLabeledArgumentSyntax
struct RawAwaitExprSyntax
struct RawBackDeployedAttributeArgumentsSyntax
struct RawBinaryOperatorExprSyntax
struct RawBooleanLiteralExprSyntax
struct RawBorrowExprSyntax
struct RawBreakStmtSyntax
struct RawCanImportExprSyntax
struct RawCanImportVersionInfoSyntax
struct RawCatchClauseListSyntax
struct RawCatchClauseSyntax
struct RawCatchItemListSyntax
struct RawCatchItemSyntax
struct RawClassDeclSyntax
struct RawClassRestrictionTypeSyntax
struct RawClosureCaptureClauseSyntax
struct RawClosureCaptureListSyntax
struct RawClosureCaptureSpecifierSyntax
struct RawClosureCaptureSyntax
struct RawClosureExprSyntax
struct RawClosureParameterClauseSyntax
struct RawClosureParameterListSyntax
struct RawClosureParameterSyntax
struct RawClosureShorthandParameterListSyntax
struct RawClosureShorthandParameterSyntax
struct RawClosureSignatureSyntax
struct RawCodeBlockItemListSyntax
struct RawCodeBlockItemSyntax
struct RawCodeBlockSyntax
struct RawCompositionTypeElementListSyntax
struct RawCompositionTypeElementSyntax
struct RawCompositionTypeSyntax
struct RawConditionElementListSyntax
struct RawConditionElementSyntax
struct RawConformanceRequirementSyntax
struct RawConsumeExprSyntax
struct RawContinueStmtSyntax
struct RawConventionAttributeArgumentsSyntax
struct RawConventionWitnessMethodAttributeArgumentsSyntax
struct RawCopyExprSyntax
struct RawDeclModifierDetailSyntax
struct RawDeclModifierListSyntax
struct RawDeclModifierSyntax
struct RawDeclNameArgumentListSyntax
struct RawDeclNameArgumentSyntax
struct RawDeclNameArgumentsSyntax
struct RawDeclReferenceExprSyntax
struct RawDeclSyntax
struct RawDeferStmtSyntax
struct RawDeinitializerDeclSyntax
struct RawDeinitializerEffectSpecifiersSyntax
struct RawDerivativeAttributeArgumentsSyntax
struct RawDesignatedTypeListSyntax
struct RawDesignatedTypeSyntax
struct RawDictionaryElementListSyntax
struct RawDictionaryElementSyntax
struct RawDictionaryExprSyntax
struct RawDictionaryTypeSyntax
struct RawDifferentiabilityArgumentListSyntax
struct RawDifferentiabilityArgumentSyntax
struct RawDifferentiabilityArgumentsSyntax
struct RawDifferentiabilityWithRespectToArgumentSyntax
struct RawDifferentiableAttributeArgumentsSyntax
struct RawDiscardAssignmentExprSyntax
struct RawDiscardStmtSyntax
struct RawDoStmtSyntax
struct RawDocumentationAttributeArgumentListSyntax
struct RawDocumentationAttributeArgumentSyntax
struct RawDynamicReplacementAttributeArgumentsSyntax
struct RawEditorPlaceholderDeclSyntax
struct RawEditorPlaceholderExprSyntax
struct RawEffectsAttributeArgumentListSyntax
struct RawEnumCaseDeclSyntax
struct RawEnumCaseElementListSyntax
struct RawEnumCaseElementSyntax
struct RawEnumCaseParameterClauseSyntax
struct RawEnumCaseParameterListSyntax
struct RawEnumCaseParameterSyntax
struct RawEnumDeclSyntax
struct RawExposeAttributeArgumentsSyntax
struct RawExprListSyntax
struct RawExprSyntax
struct RawExpressionPatternSyntax
struct RawExpressionSegmentSyntax
struct RawExpressionStmtSyntax
struct RawExtensionDeclSyntax
struct RawFallThroughStmtSyntax
struct RawFloatLiteralExprSyntax
struct RawForStmtSyntax
struct RawForceUnwrapExprSyntax
struct RawFunctionCallExprSyntax
struct RawFunctionDeclSyntax
struct RawFunctionEffectSpecifiersSyntax
struct RawFunctionParameterClauseSyntax
struct RawFunctionParameterListSyntax
struct RawFunctionParameterSyntax
struct RawFunctionSignatureSyntax
struct RawFunctionTypeSyntax
struct RawGenericArgumentClauseSyntax
struct RawGenericArgumentListSyntax
struct RawGenericArgumentSyntax
struct RawGenericParameterClauseSyntax
struct RawGenericParameterListSyntax
struct RawGenericParameterSyntax
struct RawGenericRequirementListSyntax
struct RawGenericRequirementSyntax
struct RawGenericSpecializationExprSyntax
struct RawGenericWhereClauseSyntax
struct RawGuardStmtSyntax
struct RawIdentifierPatternSyntax
struct RawIdentifierTypeSyntax
struct RawIfConfigClauseListSyntax
struct RawIfConfigClauseSyntax
struct RawIfConfigDeclSyntax
struct RawIfExprSyntax
struct RawImplementsAttributeArgumentsSyntax
struct RawImplicitlyUnwrappedOptionalTypeSyntax
struct RawImportDeclSyntax
struct RawImportPathComponentListSyntax
struct RawImportPathComponentSyntax
struct RawInOutExprSyntax
struct RawInfixOperatorExprSyntax
struct RawInheritanceClauseSyntax
struct RawInheritedTypeListSyntax
struct RawInheritedTypeSyntax
struct RawInitializerClauseSyntax
struct RawInitializerDeclSyntax
struct RawIntegerLiteralExprSyntax
struct RawIsExprSyntax
struct RawIsTypePatternSyntax
struct RawKeyPathComponentListSyntax
struct RawKeyPathComponentSyntax
struct RawKeyPathExprSyntax
struct RawKeyPathOptionalComponentSyntax
struct RawKeyPathPropertyComponentSyntax
struct RawKeyPathSubscriptComponentSyntax
struct RawLabeledExprListSyntax
struct RawLabeledExprSyntax
struct RawLabeledSpecializeArgumentSyntax
struct RawLabeledStmtSyntax
struct RawLayoutRequirementSyntax
struct RawMacroDeclSyntax
struct RawMacroExpansionDeclSyntax
struct RawMacroExpansionExprSyntax
struct RawMatchingPatternConditionSyntax
struct RawMemberAccessExprSyntax
struct RawMemberBlockItemListSyntax
struct RawMemberBlockItemSyntax
struct RawMemberBlockSyntax
struct RawMemberTypeSyntax
struct RawMetatypeTypeSyntax
struct RawMissingDeclSyntax
struct RawMissingExprSyntax
struct RawMissingPatternSyntax
struct RawMissingStmtSyntax
struct RawMissingSyntax
struct RawMissingTypeSyntax
struct RawMultipleTrailingClosureElementListSyntax
struct RawMultipleTrailingClosureElementSyntax
struct RawNamedOpaqueReturnTypeSyntax
struct RawNilLiteralExprSyntax
struct RawObjCSelectorPieceListSyntax
struct RawObjCSelectorPieceSyntax
struct RawOpaqueReturnTypeOfAttributeArgumentsSyntax
struct RawOperatorDeclSyntax
struct RawOperatorPrecedenceAndTypesSyntax
struct RawOptionalBindingConditionSyntax
struct RawOptionalChainingExprSyntax
struct RawOptionalTypeSyntax
struct RawOriginallyDefinedInAttributeArgumentsSyntax
struct RawPackElementExprSyntax
struct RawPackElementTypeSyntax
struct RawPackExpansionExprSyntax
struct RawPackExpansionTypeSyntax
struct RawPatternBindingListSyntax
struct RawPatternBindingSyntax
struct RawPatternExprSyntax
struct RawPatternSyntax
struct RawPlatformVersionItemListSyntax
struct RawPlatformVersionItemSyntax
struct RawPlatformVersionSyntax
struct RawPostfixIfConfigExprSyntax
struct RawPostfixOperatorExprSyntax
struct RawPoundSourceLocationArgumentsSyntax
struct RawPoundSourceLocationSyntax
struct RawPrecedenceGroupAssignmentSyntax
struct RawPrecedenceGroupAssociativitySyntax
struct RawPrecedenceGroupAttributeListSyntax
struct RawPrecedenceGroupDeclSyntax
struct RawPrecedenceGroupNameListSyntax
struct RawPrecedenceGroupNameSyntax
struct RawPrecedenceGroupRelationSyntax
struct RawPrefixOperatorExprSyntax
struct RawPrimaryAssociatedTypeClauseSyntax
struct RawPrimaryAssociatedTypeListSyntax
struct RawPrimaryAssociatedTypeSyntax
struct RawProtocolDeclSyntax
struct RawRegexLiteralExprSyntax
struct RawRepeatStmtSyntax
struct RawReturnClauseSyntax
struct RawReturnStmtSyntax
struct RawSameTypeRequirementSyntax
struct RawSequenceExprSyntax
struct RawSimpleStringLiteralExprSyntax
struct RawSimpleStringLiteralSegmentListSyntax
struct RawSomeOrAnyTypeSyntax
struct RawSourceFileSyntax
struct RawSpecializeAttributeArgumentListSyntax
struct RawSpecializeAvailabilityArgumentSyntax
struct RawSpecializeTargetFunctionArgumentSyntax
struct RawStmtSyntax
struct RawStringLiteralExprSyntax
struct RawStringLiteralSegmentListSyntax
struct RawStringSegmentSyntax
struct RawStructDeclSyntax
struct RawSubscriptCallExprSyntax
struct RawSubscriptDeclSyntax
struct RawSuperExprSyntax
struct RawSuppressedTypeSyntax
struct RawSwitchCaseItemListSyntax
struct RawSwitchCaseItemSyntax
struct RawSwitchCaseLabelSyntax
struct RawSwitchCaseListSyntax
struct RawSwitchCaseSyntax
struct RawSwitchDefaultLabelSyntax
struct RawSwitchExprSyntax
struct RawSyntax
Represents the raw tree structure underlying the syntax tree. These nodes have no notion of identity and only provide structure to the tree. They are immutable and can be freely shared between syntax nodes.
struct RawSyntaxLayoutView
A view into
RawSyntax
that exposes functionality that only applies to layout nodes.struct RawSyntaxTokenView
A view into
RawSyntax
that exposes functionality that only applies to tokens.struct RawTernaryExprSyntax
struct RawThenStmtSyntax
struct RawThrowStmtSyntax
enum RawTokenKind
struct RawTokenSyntax
enum RawTriviaPiece
Trivia piece for token RawSyntax.
struct RawTryExprSyntax
struct RawTupleExprSyntax
struct RawTuplePatternElementListSyntax
struct RawTuplePatternElementSyntax
struct RawTuplePatternSyntax
struct RawTupleTypeElementListSyntax
struct RawTupleTypeElementSyntax
struct RawTupleTypeSyntax
struct RawTypeAliasDeclSyntax
struct RawTypeAnnotationSyntax
struct RawTypeEffectSpecifiersSyntax
struct RawTypeExprSyntax
struct RawTypeInitializerClauseSyntax
struct RawTypeSyntax
struct RawUnderscorePrivateAttributeArgumentsSyntax
struct RawUnexpectedNodesSyntax
struct RawUnresolvedAsExprSyntax
struct RawUnresolvedIsExprSyntax
struct RawUnresolvedTernaryExprSyntax
struct RawValueBindingPatternSyntax
struct RawVariableDeclSyntax
struct RawVersionComponentListSyntax
struct RawVersionComponentSyntax
struct RawVersionTupleSyntax
struct RawWhereClauseSyntax
struct RawWhileStmtSyntax
struct RawWildcardPatternSyntax
struct RawYieldStmtSyntax
struct RawYieldedExpressionListSyntax
struct RawYieldedExpressionSyntax
struct RawYieldedExpressionsClauseSyntax
struct SyntaxIndexInTree
Represents a unique value for a node within its own tree.
enum SyntaxMemoryLayout
struct SyntaxText
Represent a string.
Typealiases
Show obsolete interfaces (68)
Hide obsolete interfaces
typealias AccessPathComponentSyntax
typealias AccessPathSyntax
/ Automatically generated by generate-swift-syntax / Do not edit directly!
typealias AccessorListSyntax
typealias AccessorParameterSyntax
typealias AssociatedtypeDeclSyntax
typealias AttributedSyntax
typealias AvailabilityEntrySyntax
typealias AvailabilitySpecListSyntax
typealias AvailabilityVersionRestrictionListEntrySyntax
typealias AvailabilityVersionRestrictionListSyntax
typealias AvailabilityVersionRestrictionSyntax
typealias BackDeployedAttributeSpecListSyntax
typealias CaseItemListSyntax
typealias CaseItemSyntax
typealias ClosureCaptureItemListSyntax
typealias ClosureCaptureItemSpecifierSyntax
typealias ClosureCaptureItemSyntax
typealias ClosureCaptureSignatureSyntax
typealias ClosureParamListSyntax
typealias ClosureParamSyntax
typealias ConstrainedSugarTypeSyntax
typealias DeinitEffectSpecifiersSyntax
typealias DerivativeRegistrationAttributeArgumentsSyntax
typealias DesignatedTypeElementSyntax
typealias DifferentiabilityParamListSyntax
typealias DifferentiabilityParamSyntax
typealias DifferentiabilityParamsClauseSyntax
typealias DifferentiabilityParamsSyntax
typealias DocumentationAttributeArgumentsSyntax
typealias DynamicReplacementArgumentsSyntax
typealias EffectsArgumentsSyntax
typealias EnumCaseAssociatedValueSyntax
typealias FallthroughStmtSyntax
typealias ForInStmtSyntax
typealias ForcedValueExprSyntax
typealias IdentifiedDeclSyntax
typealias IdentifierExprSyntax
typealias LabeledSpecializeEntrySyntax
typealias MemberDeclBlockSyntax
typealias MemberDeclListItemSyntax
typealias MemberDeclListSyntax
typealias MemberTypeIdentifierSyntax
typealias ModifierListSyntax
typealias MoveExprSyntax
typealias ObjCSelectorSyntax
typealias OriginallyDefinedInArgumentsSyntax
typealias PackReferenceTypeSyntax
typealias ParameterClauseSyntax
typealias PostfixUnaryExprSyntax
typealias PoundSourceLocationArgsSyntax
typealias PrecedenceGroupNameElementSyntax
typealias RepeatWhileStmtSyntax
typealias SimpleTypeIdentifierSyntax
typealias SpecializeAttributeSpecListSyntax
typealias SpecializeExprSyntax
typealias StringLiteralSegmentsSyntax
typealias SubscriptExprSyntax
typealias SuperRefExprSyntax
typealias TargetFunctionEntrySyntax
typealias TupleExprElementListSyntax
typealias TupleExprElementSyntax
typealias TypeInheritanceClauseSyntax
typealias TypealiasDeclSyntax
typealias UnresolvedPatternExprSyntax
typealias YieldExprListElementSyntax
typealias YieldExprListSyntax
typealias YieldListSyntax
Show system interfaces (1)
Hide system interfaces
Globals
func assert(@autoclosure () -> Bool, @autoclosure () -> String, file: StaticString, line: UInt
) An assertion that is active in DEBUG builds, just like
Swift.assert
and additionally if assertions are explicitly requested by setting theSWIFTSYNTAX_ENABLE_ASSERTIONS
conditional compilation flag. Use this instead ofprecondition
in places where the assertion has a non-trivial cost but provides little value in release builds.func assertionFailure(@autoclosure () -> String, file: StaticString, line: UInt
) An assertion that is active in DEBUG builds, just like
Swift.assertionFailure
and additionally if assertions are explicitly requested by setting theSWIFTSYNTAX_ENABLE_ASSERTIONS
conditional compilation flag.func findCommonAncestorOrSelf([Syntax]
) -> Syntax? Returns the bottommost node whose subtree contains all nodes in
nodes
.func findCommonAncestorOrSelf(Syntax, Syntax
) -> Syntax? Returns the bottommost node whose subtree contains both
lhs
andrhs
.func precondition(@autoclosure () -> Bool, @autoclosure () -> String, file: StaticString, line: UInt
) Override Swift’s
precondition
with slightly changed semantics. In release builds, it also emits the error message upon failure, likefatalError
. It can also be disabled by setting theSWIFTSYNTAX_DISABLE_PRECONDITION
conditional compilation flag. Note thatSWIFTSYNTAX_DISABLE_PRECONDITION
does not disablepreconditionFailure
.
Show system interfaces (1)
Hide system interfaces
func childName(AnyKeyPath
) -> String? If the keyPath is one from a layout structure, return the property name of it.
Other modules
SwiftBasicFormat
SwiftCompilerPlugin
SwiftCompilerPluginMessageHandling
SwiftDiagnostics
SwiftIDEUtils
SwiftOperators
An implementation of Swift’s user-defined operator declarations and precedence groups, allowing a program to reason about the relative precedence of infix operations and transform syntax trees to describe the order of operations.
SwiftParser
A parser for the Swift programming language.
SwiftParserDiagnostics
SwiftRefactor
SwiftSyntax509
SwiftSyntax510
SwiftSyntaxBuilder
SwiftSyntaxBuilder is a tool for generating Swift code in a convenient way using result builders.
SwiftSyntaxMacroExpansion
SwiftSyntaxMacros
An experimental library to provide syntactic macro support for Swift. New macros can be introduced by creating new types that conform to the various
*Macro
protocols, e.g.,ExpressionMacro
for an expression-like macro. TheMacroSystem
can then rewrite uses of that those macros in the source code. This library is a prototype for a potential Swift macro feature, but is not tied in with the compiler like such a feature would be.SwiftSyntaxMacrosTestSupport
_SwiftSyntaxTestSupport