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