aboutsummaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-12-13 16:46:48 +0000
committerGitHub <noreply@github.com>2020-12-13 16:46:48 +0000
commit43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e (patch)
tree6486bd0491db555ea6e0e18a1583e2a1098d7e1b /Grammar
parentda431f789bd1e6b9790f06f9ce47b3ec6a701e65 (diff)
downloadcpython3-43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e.tar.gz
bpo-30858: Improve error location for expressions with assignments (GH-23753)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 9f47094914..4915cc43e8 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -646,7 +646,7 @@ invalid_arguments:
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "Generator expression must be parenthesized") }
| a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }
invalid_kwarg:
- | a=expression '=' {
+ | expression a='=' {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
a, "expression cannot contain assignment, perhaps you meant \"==\"?") }
invalid_named_expression: