Commit f5c1058
gh-153171: Produce specialized syntax errors in more cases
Report "'not' after an operator must be parenthesized" also for
'not' after shift, bitwise, comparison and power operators (each
operator tier gets its own error rule; a single rule matching bare
'not' at the operand position would misfire when a valid leading
'not' expression is followed by garbage).
Report "expected default value expression" also for a missing
parameter default value before ':' in lambda expressions and for
a missing type parameter default value (previously the latter
reported a misleading "expected '('").
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 1034e73 commit f5c1058
4 files changed
Lines changed: 1153 additions & 409 deletions
File tree
- Grammar
- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Parser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
| 786 | + | |
786 | 787 | | |
787 | 788 | | |
788 | 789 | | |
| |||
825 | 826 | | |
826 | 827 | | |
827 | 828 | | |
| 829 | + | |
828 | 830 | | |
829 | 831 | | |
830 | 832 | | |
| |||
835 | 837 | | |
836 | 838 | | |
837 | 839 | | |
| 840 | + | |
838 | 841 | | |
839 | 842 | | |
840 | 843 | | |
| |||
863 | 866 | | |
864 | 867 | | |
865 | 868 | | |
| 869 | + | |
866 | 870 | | |
867 | 871 | | |
868 | 872 | | |
| |||
1373 | 1377 | | |
1374 | 1378 | | |
1375 | 1379 | | |
1376 | | - | |
| 1380 | + | |
1377 | 1381 | | |
1378 | 1382 | | |
1379 | 1383 | | |
| |||
1640 | 1644 | | |
1641 | 1645 | | |
1642 | 1646 | | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
1643 | 1655 | | |
1644 | 1656 | | |
| 1657 | + | |
| 1658 | + | |
1645 | 1659 | | |
1646 | 1660 | | |
1647 | 1661 | | |
1648 | 1662 | | |
1649 | 1663 | | |
1650 | 1664 | | |
| 1665 | + | |
1651 | 1666 | | |
1652 | 1667 | | |
1653 | 1668 | | |
1654 | 1669 | | |
1655 | 1670 | | |
1656 | 1671 | | |
1657 | 1672 | | |
| 1673 | + | |
1658 | 1674 | | |
1659 | 1675 | | |
1660 | 1676 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
660 | 664 | | |
661 | 665 | | |
662 | 666 | | |
| |||
2284 | 2288 | | |
2285 | 2289 | | |
2286 | 2290 | | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
2287 | 2323 | | |
2288 | 2324 | | |
2289 | 2325 | | |
| |||
2588 | 2624 | | |
2589 | 2625 | | |
2590 | 2626 | | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
2591 | 2647 | | |
2592 | 2648 | | |
2593 | 2649 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments