Commit 2304c47
committed
Validate token choices in CI
This changes the the paradigm around token validation in SwiftSyntax. Previously, we always validated that the `RawSyntax` tree layout was as expected in debug builds (independent of whether we forced assertions on). This property should always be guaranteed by our API unless you are replacing children manually. Verification that the tokens in the tree matched the token choices, on the other hand, was always disabled unless you specifically enabled it by modifying Package.swift.
This changes the paradigm by enabling `RawSyntax` layout and token validation whenever the `SWIFTSYNTAX_ENABLE_RAWSYNTAX_VALIDATION` conditional compilation flag is set. I am planning to set this compilation flag on SwiftSyntax’s PR testing jobs at first and, after considering the performance impact, also on Swift’s PR jobs. This should give us two advantages:
- In CI we get more extensive tree validation because we are now also validate the token choices
- If we are just building SwiftSyntax as a package dependency in SwiftPM, we get faster performance because we skip the `RawSyntax` layout validation (which is really just a way to debug serious issues while working on SwiftSyntax itself).1 parent 9df5d69 commit 2304c47
File tree
3 files changed
+32
-18
lines changed- Sources/SwiftSyntax/generated/raw
3 files changed
+32
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
Lines changed: 1 addition & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
| |||
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 153 | | |
158 | 154 | | |
159 | 155 | | |
| |||
166 | 162 | | |
167 | 163 | | |
168 | 164 | | |
169 | | - | |
170 | 165 | | |
171 | 166 | | |
172 | 167 | | |
| |||
193 | 188 | | |
194 | 189 | | |
195 | 190 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 191 | | |
200 | 192 | | |
201 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| 186 | + | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| |||
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
| |||
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
277 | | - | |
| 282 | + | |
| 283 | + | |
278 | 284 | | |
279 | 285 | | |
280 | 286 | | |
| |||
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| 301 | + | |
295 | 302 | | |
296 | 303 | | |
297 | 304 | | |
| |||
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
| 406 | + | |
399 | 407 | | |
400 | 408 | | |
401 | 409 | | |
| |||
414 | 422 | | |
415 | 423 | | |
416 | 424 | | |
| 425 | + | |
| 426 | + | |
417 | 427 | | |
418 | 428 | | |
419 | 429 | | |
| |||
461 | 471 | | |
462 | 472 | | |
463 | 473 | | |
464 | | - | |
| 474 | + | |
465 | 475 | | |
466 | 476 | | |
467 | 477 | | |
| |||
484 | 494 | | |
485 | 495 | | |
486 | 496 | | |
487 | | - | |
| 497 | + | |
488 | 498 | | |
489 | 499 | | |
490 | 500 | | |
| |||
496 | 506 | | |
497 | 507 | | |
498 | 508 | | |
499 | | - | |
| 509 | + | |
500 | 510 | | |
501 | 511 | | |
502 | 512 | | |
| |||
552 | 562 | | |
553 | 563 | | |
554 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
555 | 574 | | |
556 | 575 | | |
557 | 576 | | |
| |||
0 commit comments