forked from VimPlug/jedi
little cleanup, removed old unused code
This commit is contained in:
@@ -574,12 +574,6 @@ def follow_call_list(call_list, follow_array=False):
|
|||||||
loop = evaluate_list_comprehension(nested_lc, loop)
|
loop = evaluate_list_comprehension(nested_lc, loop)
|
||||||
return loop
|
return loop
|
||||||
|
|
||||||
if pr.Array.is_type(call_list, pr.Array.TUPLE, pr.Array.DICT):
|
|
||||||
raise NotImplementedError('TODO')
|
|
||||||
# Tuples can stand just alone without any braces. These would be
|
|
||||||
# recognized as separate calls, but actually are a tuple.
|
|
||||||
result = follow_call(call_list)
|
|
||||||
else:
|
|
||||||
result = []
|
result = []
|
||||||
calls_iterator = iter(call_list)
|
calls_iterator = iter(call_list)
|
||||||
for call in calls_iterator:
|
for call in calls_iterator:
|
||||||
@@ -602,7 +596,6 @@ def follow_call_list(call_list, follow_array=False):
|
|||||||
# With things like params, these can also be functions...
|
# With things like params, these can also be functions...
|
||||||
elif isinstance(call, (er.Function, er.Class, er.Instance,
|
elif isinstance(call, (er.Function, er.Class, er.Instance,
|
||||||
dynamic.ArrayInstance)):
|
dynamic.ArrayInstance)):
|
||||||
# TODO this is just not very well readable -> fix, use pr.Base
|
|
||||||
result.append(call)
|
result.append(call)
|
||||||
# The string tokens are just operations (+, -, etc.)
|
# The string tokens are just operations (+, -, etc.)
|
||||||
elif not isinstance(call, (str, unicode)):
|
elif not isinstance(call, (str, unicode)):
|
||||||
|
|||||||
@@ -216,17 +216,6 @@ class InstanceElement(use_metaclass(cache.CachedMetaClass)):
|
|||||||
return func
|
return func
|
||||||
|
|
||||||
def get_commands(self):
|
def get_commands(self):
|
||||||
"""
|
|
||||||
# TODO delete ?
|
|
||||||
# Copy and modify the array.
|
|
||||||
origin = self.var.get_commands()
|
|
||||||
# Delete parent, because it isn't used anymore.
|
|
||||||
new = helpers.fast_parent_copy(origin)
|
|
||||||
par = InstanceElement(self.instance, origin.parent_stmt,
|
|
||||||
self.is_class_var)
|
|
||||||
new.parent_stmt = par
|
|
||||||
return new
|
|
||||||
"""
|
|
||||||
# Copy and modify the array.
|
# Copy and modify the array.
|
||||||
return [InstanceElement(self.instance, command, self.is_class_var)
|
return [InstanceElement(self.instance, command, self.is_class_var)
|
||||||
for command in self.var.get_commands()]
|
for command in self.var.get_commands()]
|
||||||
@@ -502,8 +491,6 @@ class Execution(Executable):
|
|||||||
"""
|
"""
|
||||||
Create a param with the original scope (of varargs) as parent.
|
Create a param with the original scope (of varargs) as parent.
|
||||||
"""
|
"""
|
||||||
# TODO remove array and param and just put the values of the \
|
|
||||||
# statement into the values of the param - it's as simple as that.
|
|
||||||
if isinstance(self.var_args, pr.Array):
|
if isinstance(self.var_args, pr.Array):
|
||||||
parent = self.var_args.parent
|
parent = self.var_args.parent
|
||||||
start_pos = self.var_args.start_pos
|
start_pos = self.var_args.start_pos
|
||||||
@@ -658,10 +645,6 @@ class Execution(Executable):
|
|||||||
yield call, value_stmt
|
yield call, value_stmt
|
||||||
elif type(call) == pr.Call:
|
elif type(call) == pr.Call:
|
||||||
yield call.name, value_stmt
|
yield call.name, value_stmt
|
||||||
else:
|
|
||||||
# `pr`.[Call|Function|Class] lookup.
|
|
||||||
# TODO remove?
|
|
||||||
yield key_stmt[0].name, value_stmt
|
|
||||||
# Normal arguments (including key arguments).
|
# Normal arguments (including key arguments).
|
||||||
else:
|
else:
|
||||||
if stmt.assignment_details:
|
if stmt.assignment_details:
|
||||||
|
|||||||
@@ -480,7 +480,6 @@ class Flow(Scope):
|
|||||||
self.set_vars = set_vars
|
self.set_vars = set_vars
|
||||||
for s in self.set_vars:
|
for s in self.set_vars:
|
||||||
s.parent.parent = self.use_as_parent
|
s.parent.parent = self.use_as_parent
|
||||||
# TODO strange!!! don't know why this exist
|
|
||||||
s.parent = self.use_as_parent
|
s.parent = self.use_as_parent
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -1000,7 +999,6 @@ class Call(Simple):
|
|||||||
|
|
||||||
def generate_call_path(self):
|
def generate_call_path(self):
|
||||||
""" Helps to get the order in which statements are executed. """
|
""" Helps to get the order in which statements are executed. """
|
||||||
# TODO include previous nodes? As an option?
|
|
||||||
try:
|
try:
|
||||||
for name_part in self.name.names:
|
for name_part in self.name.names:
|
||||||
yield name_part
|
yield name_part
|
||||||
|
|||||||
Reference in New Issue
Block a user