forked from VimPlug/jedi
Check for recursions in dynamic arrays.
This commit is contained in:
@@ -522,7 +522,7 @@ def _check_array_additions(evaluator, compare_array, module, is_list):
|
|||||||
search_names = ['append', 'extend', 'insert'] if is_list else ['add', 'update']
|
search_names = ['append', 'extend', 'insert'] if is_list else ['add', 'update']
|
||||||
comp_arr_parent = get_execution_parent(compare_array)
|
comp_arr_parent = get_execution_parent(compare_array)
|
||||||
|
|
||||||
res = []
|
added_types = []
|
||||||
for add_name in search_names:
|
for add_name in search_names:
|
||||||
try:
|
try:
|
||||||
possible_names = module.used_names[add_name]
|
possible_names = module.used_names[add_name]
|
||||||
@@ -561,18 +561,18 @@ def _check_array_additions(evaluator, compare_array, module, is_list):
|
|||||||
or execution_trailer.children[1] == ')':
|
or execution_trailer.children[1] == ')':
|
||||||
continue
|
continue
|
||||||
power = helpers.call_of_name(name, cut_own_trailer=True)
|
power = helpers.call_of_name(name, cut_own_trailer=True)
|
||||||
#if evaluator.recursion_detector.push_stmt(stmt):
|
if evaluator.recursion_detector.push_stmt(power):
|
||||||
# check recursion
|
# Check for recursion. Possible by using 'extend' in
|
||||||
# continue
|
# combination with function calls.
|
||||||
|
continue
|
||||||
if compare_array in evaluator.eval_element(power):
|
if compare_array in evaluator.eval_element(power):
|
||||||
# The arrays match.
|
# The arrays match. Now add the results
|
||||||
res += get_additions(execution_trailer.children[1], add_name)
|
added_types += get_additions(execution_trailer.children[1], add_name)
|
||||||
|
|
||||||
#res += check_power(call)
|
evaluator.recursion_detector.pop_stmt()
|
||||||
#evaluator.recursion_detector.pop_stmt()
|
|
||||||
# reset settings
|
# reset settings
|
||||||
settings.dynamic_params_for_other_modules = temp_param_add
|
settings.dynamic_params_for_other_modules = temp_param_add
|
||||||
return res
|
return added_types
|
||||||
|
|
||||||
|
|
||||||
def check_array_instances(evaluator, instance):
|
def check_array_instances(evaluator, instance):
|
||||||
|
|||||||
Reference in New Issue
Block a user