forked from VimPlug/jedi
make the second test pass
This commit is contained in:
@@ -315,7 +315,7 @@ def check_array_instances(instance):
|
||||
if not settings.dynamic_arrays_instances:
|
||||
return instance.var_args
|
||||
ai = ArrayInstance(instance)
|
||||
return helpers.generate_param_array([ai], instance.var_args.parent_stmt)
|
||||
return [ai]
|
||||
|
||||
|
||||
class ArrayInstance(pr.Base):
|
||||
|
||||
@@ -285,17 +285,16 @@ def find_name(scope, name_str, position=None, search_global=False,
|
||||
inst.is_generated = True
|
||||
result.append(inst)
|
||||
elif par.isinstance(pr.Statement):
|
||||
def is_execution(arr):
|
||||
for a in arr:
|
||||
a = a[0] # rest is always empty with assignees
|
||||
if a.isinstance(pr.Array):
|
||||
if is_execution(a):
|
||||
def is_execution(calls):
|
||||
for c in calls:
|
||||
if c.isinstance(pr.Array):
|
||||
if is_execution(c):
|
||||
return True
|
||||
elif a.isinstance(pr.Call):
|
||||
elif c.isinstance(pr.Call):
|
||||
# Compare start_pos, because names may be different
|
||||
# because of executions.
|
||||
if a.name.start_pos == name.start_pos \
|
||||
and a.execution:
|
||||
if c.name.start_pos == name.start_pos \
|
||||
and c.execution:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user