mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-110696: Fix incorrect syntax error message for incorrect argument unpacking (#110706)
This commit is contained in:
parent
ec5622d197
commit
3d180347ae
4 changed files with 2447 additions and 2081 deletions
|
@ -1128,7 +1128,8 @@ func_type_comment[Token*]:
|
|||
|
||||
# From here on, there are rules for invalid syntax with specialised error messages
|
||||
invalid_arguments:
|
||||
| a=args ',' '*' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "iterable argument unpacking follows keyword argument unpacking") }
|
||||
| ((','.(starred_expression | ( assignment_expression | expression !':=') !'=')+ ',' kwargs) | kwargs) ',' b='*' {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(b, "iterable argument unpacking follows keyword argument unpacking") }
|
||||
| a=expression b=for_if_clauses ',' [args | expression for_if_clauses] {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, _PyPegen_get_last_comprehension_item(PyPegen_last_item(b, comprehension_ty)), "Generator expression must be parenthesized") }
|
||||
| a=NAME b='=' expression for_if_clauses {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue