mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 21:34:32 +08:00
Add issue 'keyword can't be an expression'
This commit is contained in:
@@ -231,6 +231,10 @@ class ErrorFinder(Normalizer):
|
||||
self._add_syntax_error(message, lhs.parent)
|
||||
else:
|
||||
self._add_syntax_error(message % type_, lhs.parent)
|
||||
elif node.type == 'argument':
|
||||
if node.children[1] == '=' and node.children[0].type != 'name':
|
||||
message = "keyword can't be an expression"
|
||||
self._add_syntax_error(message, node.children[0])
|
||||
|
||||
yield
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ def test_indentation_errors(code, positions):
|
||||
'(a, b): int',
|
||||
'*star,: int',
|
||||
'a, b: int = 3',
|
||||
'foo(+a=3)',
|
||||
|
||||
# IndentationError
|
||||
' foo',
|
||||
|
||||
Reference in New Issue
Block a user