Commit 9b20906
committed
Accept unparenthesized exception groups in except clauses
PEP 758, accepted for Python 3.14, allows `except A, B:` and
`except* A, B:` without parentheses when there is no `as` clause. The
parser rejects both today, so a file using the new form fails to parse
rather than producing a tree.
`GenericList` already collapses a single element to itself and wraps the
rest in a tuple, which is the shape CPython produces here, so this is one
production per clause. The `as` form is untouched: PEP 758 keeps
parentheses required there.
python.rs is regenerated with lalrpop 0.20.0, the version that produced
the file in tree. The diff is large because the state table renumbers.1 parent 1834307 commit 9b20906
4 files changed
Lines changed: 9996 additions & 9432 deletions
File tree
- parser/src
- snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
866 | 884 | | |
867 | 885 | | |
868 | 886 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
881 | | - | |
| 881 | + | |
| 882 | + | |
882 | 883 | | |
883 | 884 | | |
884 | 885 | | |
| |||
904 | 905 | | |
905 | 906 | | |
906 | 907 | | |
907 | | - | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
908 | 913 | | |
909 | 914 | | |
910 | 915 | | |
| |||
0 commit comments