summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-12-13 16:46:48 (GMT)
committerGitHub <noreply@github.com>2020-12-13 16:46:48 (GMT)
commit43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e (patch)
tree6486bd0491db555ea6e0e18a1583e2a1098d7e1b /Parser
parentda431f789bd1e6b9790f06f9ce47b3ec6a701e65 (diff)
downloadcpython-43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e.zip
cpython-43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e.tar.gz
cpython-43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e.tar.bz2
bpo-30858: Improve error location for expressions with assignments (GH-23753)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Parser/parser.c b/Parser/parser.c
index b6c0495..2559969 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -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 '='"));