1
0
forked from VimPlug/jedi

scan_statement -> scan_statement_for_calls

This commit is contained in:
Dave Halter
2014-01-07 15:10:19 +01:00
parent 359f3ed4a9
commit a74b7299e2
4 changed files with 8 additions and 8 deletions

View File

@@ -766,7 +766,7 @@ def usages(evaluator, definitions, search_name, mods):
if set(f) & set(definitions):
names.append(api_classes.Usage(evaluator, name_part, stmt))
else:
for call in helpers.scan_statement(stmt, search_name,
for call in helpers.scan_statements(stmt, search_name,
assignment_details=True):
names += check_call(call)
return names

View File

@@ -103,7 +103,7 @@ def search_params(evaluator, param):
for stmt in possible_stmts:
if isinstance(stmt, pr.Import):
continue
calls = helpers.scan_statement(stmt, func_name)
calls = helpers.scan_statement_for_calls(stmt, func_name)
for c in calls:
# no execution means that params cannot be set
call_path = list(c.generate_call_path())

View File

@@ -170,17 +170,17 @@ def search_call_signatures(stmt, pos):
return None, 0, False
def scan_statement(stmt, search_name, assignment_details=False):
""" Returns the function Call that match search_name in an Array. """
def scan_statement_for_calls(stmt, search_name, assignment_details=False):
""" Returns the function Calls that match search_name in an Array. """
def scan_array(arr, search_name):
result = []
if arr.type == pr.Array.DICT:
for key_stmt, value_stmt in arr.items():
result += scan_statement(key_stmt, search_name)
result += scan_statement(value_stmt, search_name)
result += scan_statement_for_calls(key_stmt, search_name)
result += scan_statement_for_calls(value_stmt, search_name)
else:
for stmt in arr:
result += scan_statement(stmt, search_name)
result += scan_statement_for_calls(stmt, search_name)
return result
check = list(stmt.expression_list())

View File

@@ -330,7 +330,7 @@ def _check_array_additions(evaluator, compare_array, module, is_list):
# check recursion
continue
res += check_calls(helpers.scan_statement(stmt, n), n)
res += check_calls(helpers.scan_statement_for_calls(stmt, n), n)
evaluator.recursion_detector.pop_stmt()
# reset settings
settings.dynamic_params_for_other_modules = temp_param_add