You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Teach ActiveSyntax(Any)Visitor to use configured regions or a build configuration
Rework the implementations of ActiveSyntax(Any)Visitor to allow configured
regions, so that clients can re-use the work of evaluating the build
configuration for later traversals.
As a side effect of this, ActiveSyntax(Any)Visitor are no longer generic
over the type of build configuration, which should make them easier to
use.
Copy file name to clipboardExpand all lines: Sources/SwiftIfConfig/SwiftIfConfig.docc/SwiftIfConfig.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -29,4 +29,5 @@ The `SwiftIfConfig` library provides utilities to determine which syntax nodes a
29
29
*<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.
30
30
*`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.
31
31
*`IfConfigDeclSyntax.activeClause(in:)` determines which of the clauses of an `#if` is active for the given build configuration, returning the active clause.
32
-
*`SyntaxProtocol.configuredRegions(in:)` produces a `ConfiguredRegions` value that can be used to efficiently test whether a given syntax node is in an active, inactive, or unparsed region (via `isActive`).
32
+
*`SyntaxProtocol.configuredRegions(in:)` produces a `ConfiguredRegions` value that can be used to efficiently test whether a given syntax node is in an active, inactive, or unparsed region, remove inactive syntax, or determine the
33
+
active clause for a given `#if`. Use `ConfiguredRegions` for repeated queries.
0 commit comments