Skip to content

Commit f04d766

Browse files
committed
Clarify documentation a little bit
1 parent 69ccf80 commit f04d766

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/SwiftIfConfig/SwiftIfConfig.docc/SwiftIfConfig.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A library to evaluate `#if` conditionals within a Swift syntax tree.
44

55
## Overview
66

7-
Swift provides the ability to conditionally compile parts of a source file based on various built-time conditions, including information about the target (operating system, processor architecture, environment), information about the compiler (version, supported attributes and features), and user-supplied conditions specified as part of the build (e.g., `DEBUG`), which we collectively refer to as the *build configuration*. These conditions can occur within a `#if` in the source code, e.g.,
7+
Swift provides the ability to conditionally compile parts of a source file based on various build-time conditions, including information about the target (operating system, processor architecture, environment), information about the compiler (version, supported attributes and features), and user-supplied conditions specified as part of the build (e.g., `DEBUG`), which we collectively refer to as the *build configuration*. These conditions can occur within a `#if` in the source code, e.g.,
88

99
```swift
1010
func f() {
@@ -29,4 +29,7 @@ The `SwiftIfConfig` library provides utilities to determine which syntax nodes a
2929
* <doc:ActiveSyntaxVisitor> and <doc:ActiveSyntaxAnyVisitor> are visitor types that only visit the syntax nodes that are included ("active") for a given build configuration, implicitly skipping any nodes within inactive `#if` clauses.
3030
* ``SyntaxProtocol/removingInactive(in:)`` produces a syntax node that removes all inactive regions (and their corresponding `IfConfigDeclSyntax` nodes) from the given syntax tree, returning a new tree that is free of `#if` conditions.
3131
* ``IfConfigDeclSyntax.activeClause(in:)`` determines which of the clauses of an `#if` is active for the given build configuration, returning the active clause.
32-
* ``SyntaxProtocol.isActive(in:)`` determines whether the given syntax node is active for the given build configuration.
32+
* ``SyntaxProtocol.isActive(in:)`` determines whether the given syntax node is active for the given build configuration. The result is one of "active"
33+
(the node is included in the program), "inactive" (the node is not included
34+
in the program), or "unparsed" (the node is not included in the program and
35+
is also allowed to have syntax errors).

0 commit comments

Comments
 (0)