@@ -29,7 +29,7 @@ let rawSyntaxValidationFile = try! SourceFileSyntax(leadingTrivia: copyrightHead
29
29
clauses: try IfConfigClauseListSyntax {
30
30
IfConfigClauseSyntax (
31
31
poundKeyword: . poundIfKeyword( ) ,
32
- condition: ExprSyntax ( " DEBUG " ) ,
32
+ condition: ExprSyntax ( " SWIFTSYNTAX_ENABLE_RAWSYNTAX_VALIDATION " ) ,
33
33
elements: . statements(
34
34
try CodeBlockItemListSyntax {
35
35
DeclSyntax (
@@ -114,14 +114,10 @@ let rawSyntaxValidationFile = try! SourceFileSyntax(leadingTrivia: copyrightHead
114
114
// the list of expected token choices in the syntax tree doesn't match those
115
115
// the parser generates. Disable the verification for now until all issues
116
116
// regarding it are fixed.
117
- #if VALIDATE_TOKEN_CHOICES
118
117
if raw != nil {
119
118
return verify(raw, as: RawTokenSyntax.self, tokenChoices: tokenChoices, file: file, line: line)
120
119
}
121
120
return nil
122
- #else
123
- return verify(raw, as: RawTokenSyntax?.self)
124
- #endif
125
121
}
126
122
"""
127
123
)
@@ -133,7 +129,6 @@ let rawSyntaxValidationFile = try! SourceFileSyntax(leadingTrivia: copyrightHead
133
129
// the list of expected token choices in the syntax tree doesn't match those
134
130
// the parser generates. Disable the verification for now until all issues
135
131
// regarding it are fixed.
136
- #if VALIDATE_TOKEN_CHOICES
137
132
guard let raw = raw else {
138
133
return .expectedNonNil(expectedKind: RawTokenSyntax.self, file: file, line: line)
139
134
}
@@ -154,9 +149,6 @@ let rawSyntaxValidationFile = try! SourceFileSyntax(leadingTrivia: copyrightHead
154
149
}
155
150
}
156
151
return ValidationError.tokenMismatch(expectedTokenChoices: tokenChoices, actualKind: tokenView.rawKind, actualText: tokenView.rawText, file: file, line: line)
157
- #else
158
- return verify(raw, as: RawTokenSyntax.self)
159
- #endif
160
152
}
161
153
162
154
"""
0 commit comments