File tree 2 files changed +15
-6
lines changed 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,18 @@ extension SyntaxProtocol {
24
24
/// func f()
25
25
/// #elseif B
26
26
/// func g()
27
+ /// #elseif compiler(>= 12.0)
28
+ /// please print the number after 41
27
29
/// #endif
28
30
/// #else
29
31
/// #endif
30
32
///
31
33
/// If the configuration options `DEBUG` and `B` are provided, but `A` is not,
32
- /// the results will be contain:
33
- /// - Active region for the `#if DEBUG`
34
- /// - Inactive region for the `#if A`
35
- /// - Active region for the `#elseif B`
34
+ /// and the compiler version is less than 12.0, the results will be contain:
35
+ /// - Active region for the `#if DEBUG`.
36
+ /// - Inactive region for the `#if A`.
37
+ /// - Active region for the `#elseif B`.
38
+ /// - Unparsed region for the `#elseif compiler(>= 12.0)`.
36
39
/// - Inactive region for the final `#else`.
37
40
public func configuredRegions(
38
41
in configuration: some BuildConfiguration
Original file line number Diff line number Diff line change @@ -23,13 +23,19 @@ extension SyntaxProtocol {
23
23
/// #if DEBUG
24
24
/// #if A
25
25
/// func f()
26
- /// #elseif B
27
- /// func g()
26
+ /// #elseif B
27
+ /// func g()
28
+ /// #elseif compiler(>= 12.0)
29
+ /// please print the number after 41
28
30
/// #endif
29
31
/// #endif
30
32
///
31
33
/// a call to `isActive` on the syntax node for the function `g` would return `active` when the
32
34
/// configuration options `DEBUG` and `B` are provided, but `A` is not.
35
+ ///
36
+ /// If the compiler version is smaller than 12.0, then `isActive` on any of the tokens within
37
+ /// that `#elseif` block would return "unparsed", because that syntax should not (conceptually)
38
+ /// be parsed.
33
39
public func isActive(
34
40
in configuration: some BuildConfiguration
35
41
) -> ( state: IfConfigRegionState , diagnostics: [ Diagnostic ] ) {
You can’t perform that action at this time.
0 commit comments