Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

ConditionalCompilationBlock_Branch

mattt edited this page Jan 22, 2020 · 9 revisions

ConditionalCompilationBlock.Branch

A conditional compilation block branch.

public enum Branch

Inheritance

Hashable, Codable, ExpressibleBySyntax


Cases

if

An #if branch.

case if(: String)

elseif

An #elseif branch.

case elseif(: String)

else

An #else branch.

case else

Initializers

init(from:)

public init(from decoder: Decoder) throws

init(_:)

Creates an instance initialized with the given syntax node.

public init(_ node: IfConfigClauseSyntax)

Properties

keyword

The branch keyword, either "#if", "#elseif", or "#else".

var keyword: String

condition

The branch condition, if any.

var condition: String?

This value is present when keyword is equal to "#if" or #elseif and nil when keyword is equal to "#else".

Methods

encode(to:)

public func encode(to encoder: Encoder) throws