mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-09 06:04:54 +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)
|
self._add_syntax_error(message, lhs.parent)
|
||||||
else:
|
else:
|
||||||
self._add_syntax_error(message % type_, lhs.parent)
|
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
|
yield
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ def test_indentation_errors(code, positions):
|
|||||||
'(a, b): int',
|
'(a, b): int',
|
||||||
'*star,: int',
|
'*star,: int',
|
||||||
'a, b: int = 3',
|
'a, b: int = 3',
|
||||||
|
'foo(+a=3)',
|
||||||
|
|
||||||
# IndentationError
|
# IndentationError
|
||||||
' foo',
|
' foo',
|
||||||
|
|||||||
Reference in New Issue
Block a user