Commit 2646663
committed
Put in
This works by adding a boolean flag, `continue_after_error`, to
`syntax::errors::Handler` that can be imperatively set to `true` or
`false` via a new `fn set_continue_after_error`.
The flag starts off true (since we generally try to recover from
compiler errors, and `Handler` is shared across all phases).
Then, during the `phase_1_parse_input`, we consult the setting of the
`-Z continue-parse-after-error` debug flag to determine whether we
should leave the flag set to `true` or should change it to `false`.
----
(We might consider adding a debugflag to do such aborts in other
places where we are currently attempting recovery, such as resolve,
but I think the parser is the really important case to handle in the
face of #31994 and the parser bugs of varying degrees that were
injected by parse error recovery.)-Z continue-parse-after-error
1 parent 40deb27 commit 2646663
3 files changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
633 | 635 | | |
634 | 636 | | |
635 | 637 | | |
| 638 | + | |
| 639 | + | |
636 | 640 | | |
637 | 641 | | |
638 | 642 | | |
| |||
1045 | 1049 | | |
1046 | 1050 | | |
1047 | 1051 | | |
| 1052 | + | |
1048 | 1053 | | |
1049 | 1054 | | |
1050 | 1055 | | |
| |||
1228 | 1233 | | |
1229 | 1234 | | |
1230 | 1235 | | |
| 1236 | + | |
1231 | 1237 | | |
1232 | 1238 | | |
1233 | 1239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
430 | 432 | | |
431 | 433 | | |
432 | 434 | | |
| |||
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
| 447 | + | |
| 448 | + | |
445 | 449 | | |
446 | 450 | | |
447 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
| |||
392 | 393 | | |
393 | 394 | | |
394 | 395 | | |
| 396 | + | |
395 | 397 | | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
399 | 405 | | |
400 | 406 | | |
401 | 407 | | |
| |||
612 | 618 | | |
613 | 619 | | |
614 | 620 | | |
| 621 | + | |
615 | 622 | | |
616 | 623 | | |
617 | 624 | | |
| |||
620 | 627 | | |
621 | 628 | | |
622 | 629 | | |
| 630 | + | |
623 | 631 | | |
624 | 632 | | |
625 | 633 | | |
626 | 634 | | |
| 635 | + | |
627 | 636 | | |
628 | 637 | | |
629 | 638 | | |
| |||
0 commit comments