File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -287,9 +287,6 @@ class ActiveSyntaxRewriter<Configuration: BuildConfiguration>: SyntaxRewriter {
287
287
return applyBaseToPostfixExpression ( base: base, postfix: postfixExpr)
288
288
}
289
289
290
- // FIXME: PostfixIfConfigExprSyntax has a different form that doesn't work
291
- // well with the way dropInactive is written. We essentially need to
292
- // thread a the "base" into the active clause.
293
290
override func visit( _ node: PostfixIfConfigExprSyntax ) -> ExprSyntax {
294
291
let rewrittenNode = dropInactive ( outerBase: nil , postfixIfConfig: node)
295
292
if rewrittenNode == ExprSyntax ( node) {
Original file line number Diff line number Diff line change @@ -51,4 +51,33 @@ public class ActiveRegionTests: XCTestCase {
51
51
]
52
52
)
53
53
}
54
+
55
+ func testActiveRegionsInPostfix( ) throws {
56
+ try assertActiveCode (
57
+ """
58
+ 4️⃣a.b()
59
+ #if DEBUG
60
+ 0️⃣.c()
61
+ #elseif ASSERTS
62
+ 1️⃣.d()
63
+ #if compiler(>=8.0)
64
+ 2️⃣.e()
65
+ #else
66
+ 3️⃣.f()
67
+ #endif
68
+ #endif
69
+ 5️⃣.g()
70
+ """ ,
71
+ configuration: linuxBuildConfig,
72
+ states: [
73
+ " 0️⃣ " : . active,
74
+ " 1️⃣ " : . inactive,
75
+ " 2️⃣ " : . unparsed,
76
+ " 3️⃣ " : . inactive,
77
+ " 4️⃣ " : . active,
78
+ " 5️⃣ " : . active,
79
+ ]
80
+ )
81
+
82
+ }
54
83
}
You can’t perform that action at this time.
0 commit comments