Structure
ConditionalCompilationBlock
public struct ConditionalCompilationBlock: Declaration, Hashable, Codable
A conditional compilation block declaration.
Relationships
Nested Types
ConditionalCompilationBlock.Branch
A conditional compilation block branch.
Conforms To
Declaration
A Swift declaration.
ExpressibleBySyntax
A type that can be initialized with a Swift syntax node.
Codable
Hashable
Initializers
init(_:)
public init(_ node: IfConfigDeclSyntax)
Creates an instance initialized with the given syntax node.
Properties
branches
let branches: [Branch]
The conditional compilation block branches.
For example, the following compilation block declaration has two branches:
#if true
enum A {}
#else
enum B {}
#endif
The first branch has the keyword #if
and condition "true"
.
The second branch has the keyword #else
and no condition.