Repository navigation
Commit 15906eb
committed
fix(swift): keep the first parse when masking directives reads less
The conditional-compilation retry always kept the masked re-parse. When
the dropped branch holds an `#error(...)` line inside a type body the
re-parse reads less of the file: Alamofire Protected.swift went from 3
to 14 unreadable lines and lost its Protected initializer.
The re-parse is now kept only when its error regions cover no more lines
than those of the first parse. Counting regions instead would reject
re-parses that split one large region into a few small ones; on
swift-nio that gave back 1,312 of the recovered lines.
Signed-off-by: Martin Vogel <[email protected]>1 parent 8087c1c commit 15906eb
1 file changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3382 | 3382 | | |
3383 | 3383 | | |
3384 | 3384 | | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
3385 | 3400 | | |
3386 | 3401 | | |
3387 | 3402 | | |
| |||
3393 | 3408 | | |
3394 | 3409 | | |
3395 | 3410 | | |
3396 | | - | |
3397 | 3411 | | |
3398 | | - | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
3399 | 3422 | | |
3400 | 3423 | | |
3401 | 3424 | | |
| |||
0 commit comments