mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-30858: Improve error location for expressions with assignments (GH-23753)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
parent
da431f789b
commit
43c4fb6c90
5 changed files with 15 additions and 6 deletions
|
@ -14562,12 +14562,12 @@ invalid_kwarg_rule(Parser *p)
|
|||
return NULL;
|
||||
}
|
||||
D(fprintf(stderr, "%*c> invalid_kwarg[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression '='"));
|
||||
Token * _literal;
|
||||
expr_ty a;
|
||||
Token * a;
|
||||
expr_ty expression_var;
|
||||
if (
|
||||
(a = expression_rule(p)) // expression
|
||||
(expression_var = expression_rule(p)) // expression
|
||||
&&
|
||||
(_literal = _PyPegen_expect_token(p, 22)) // token='='
|
||||
(a = _PyPegen_expect_token(p, 22)) // token='='
|
||||
)
|
||||
{
|
||||
D(fprintf(stderr, "%*c+ invalid_kwarg[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression '='"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue