mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix a case with errors
This commit is contained in:
@@ -263,8 +263,13 @@ def _iter_arguments(nodes, position):
|
||||
stars_seen = 0
|
||||
elif node.type in ('testlist', 'testlist_star_expr'): # testlist is Python 2
|
||||
for n in node.children[::2]:
|
||||
if n.type == 'star_expr':
|
||||
stars_seen = 1
|
||||
n = n.children[1]
|
||||
yield stars_seen, remove_after_pos(n), False
|
||||
stars_seen = 0
|
||||
# The count of children is even if there's a comma at the end.
|
||||
previous_node_yielded = bool(len(node.children) % 2)
|
||||
elif isinstance(node, tree.PythonLeaf) and node.value == ',':
|
||||
if not previous_node_yielded:
|
||||
yield stars_seen, '', False
|
||||
|
||||
@@ -478,7 +478,11 @@ _calls = [
|
||||
# Error nodes
|
||||
(code4, 'i(1, [a,b', 1),
|
||||
(code4, 'i(1, [a,b=,', 2),
|
||||
(code4, 'i(1, [a!b,', 2),
|
||||
(code4, 'i(1, [a?b,', 2),
|
||||
(code4, 'i(1, [a?b,*', 2),
|
||||
(code4, 'i(?b,*r,c', 1),
|
||||
(code4, 'i(?*', 0),
|
||||
(code4, 'i(?**', 1),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user