@@ -192,29 +192,21 @@ fileprivate class ConfiguredRegionVisitor<Configuration: BuildConfiguration>: Sy
192192 let isActive : Bool
193193 if let condition = clause. condition {
194194 if !foundActive {
195- // Fold operators so we can evaluate this #if condition.
196- let ( foldedCondition, foldDiagnostics) = IfConfigClauseSyntax . foldOperators ( condition)
197- diagnostics. append ( contentsOf: foldDiagnostics)
198-
199195 // In an active region, evaluate the condition to determine whether
200196 // this clause is active. Otherwise, this clause is inactive.
201197 if inActiveRegion {
202198 let ( thisIsActive, _, evalDiagnostics) = evaluateIfConfig (
203- condition: foldedCondition ,
199+ condition: condition ,
204200 configuration: configuration
205201 )
206202 diagnostics. append ( contentsOf: evalDiagnostics)
207203
208204 // Determine if there was an error that prevented us from
209205 // evaluating the condition. If so, we'll allow syntax errors
210206 // from here on out.
211- let hadError =
212- foldDiagnostics. contains { diag in
213- diag. diagMessage. severity == . error
214- }
215- || evalDiagnostics. contains { diag in
216- diag. diagMessage. severity == . error
217- }
207+ let hadError = evalDiagnostics. contains { diag in
208+ diag. diagMessage. severity == . error
209+ }
218210
219211 if hadError {
220212 isActive = false
@@ -223,14 +215,14 @@ fileprivate class ConfiguredRegionVisitor<Configuration: BuildConfiguration>: Sy
223215 isActive = thisIsActive
224216
225217 // Determine whether syntax errors are allowed.
226- syntaxErrorsAllowed = foldedCondition . allowsSyntaxErrorsFolded
218+ syntaxErrorsAllowed = condition . allowsSyntaxErrorsFolded
227219 }
228220 } else {
229221 isActive = false
230222
231223 // Determine whether syntax errors are allowed, even though we
232224 // skipped evaluation of the actual condition.
233- syntaxErrorsAllowed = foldedCondition . allowsSyntaxErrorsFolded
225+ syntaxErrorsAllowed = condition . allowsSyntaxErrorsFolded
234226 }
235227 } else {
236228 // We already found an active condition, so this is inactive.
0 commit comments