-
Notifications
You must be signed in to change notification settings - Fork 31
ConditionalCompilationBlock
A conditional compilation block declaration.
public struct ConditionalCompilationBlock: Declaration, Hashable, Codable
Codable
, Hashable
, Declaration
ConditionalCompilationBlock.Branch
public init(from decoder: Decoder) throws
Creates an instance initialized with the given syntax node.
public init(_ node: IfConfigDeclSyntax)
Creates an instance initialized with the given syntax node.
public init(_ node: IfConfigClauseSyntax)
The conditional compilation block branches.
let branches: [Branch]
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.
A dot-delimited (.
) path describing the enclosing scope
of the conditional compilation block declaration,
or nil
if the conditional compilation block isn't nested
(that is, declared at the top-level scope of a module).
let context: String?
For example,
the following conditional compilation block declaration
has the context "A.B"
:
enum A {
enum B {
#if true
enum C {}
#endif
}
}
public func encode(to encoder: Encoder) throws
Generated at 2020-08-02T12:14:07+0000 using swift-doc 1.0.0-beta.3.
Types
- AssociatedType
- Attribute
- Attribute.Argument
- Class
- ConditionalCompilationBlock
- ConditionalCompilationBlock.Branch
- DeclarationCollector
- Deinitializer
- Enumeration
- Enumeration.Case
- Extension
- Function
- Function.Parameter
- Function.Signature
- GenericParameter
- GenericRequirement
- GenericRequirement.Relation
- Import
- Initializer
- Modifier
- Operator
- Operator.Kind
- PrecedenceGroup
- PrecedenceGroup.Associativity
- PrecedenceGroup.Relation
- Protocol
- Structure
- Subscript
- Typealias
- Variable
- Variable.Accessor
- Variable.Accessor.Kind