SwiftSemantics Documentation Beta

Structure Conditional​Compilation​Block

public struct ConditionalCompilationBlock: Declaration, Hashable, Codable

A conditional compilation block declaration.

%3 ConditionalCompilationBlock ConditionalCompilationBlock Hashable Hashable ConditionalCompilationBlock->Hashable ExpressibleBySyntax ExpressibleBySyntax ConditionalCompilationBlock->ExpressibleBySyntax Declaration Declaration ConditionalCompilationBlock->Declaration Codable Codable ConditionalCompilationBlock->Codable

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.