1
0
forked from VimPlug/jedi

Start using ExprStmt.

This commit is contained in:
Dave Halter
2014-09-06 10:46:59 +02:00
parent f57d9ef675
commit cb84bc0829
3 changed files with 4 additions and 4 deletions

View File

@@ -147,7 +147,7 @@ def search_call_signatures(user_stmt, position):
"""
debug.speed('func_call start')
call, arr, index = None, None, 0
if user_stmt is not None and isinstance(user_stmt, pr.Statement):
if user_stmt is not None and isinstance(user_stmt, pr.ExprStmt):
# some parts will of the statement will be removed
user_stmt = deep_ast_copy(user_stmt)
arr, index, call = call_signature_array_for_pos(user_stmt, position)
@@ -284,7 +284,7 @@ class FakeArray(pr.Array):
self.values = values
class FakeStatement(pr.Statement):
class FakeStatement(pr.ExprStmt):
def __init__(self, expression_list, start_pos=(0, 0), parent=None):
p = start_pos
super(FakeStatement, self).__init__(FakeSubModule, expression_list, p, p)

View File

@@ -271,7 +271,7 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
return pr.Simple.get_parent_until(self, *args, **kwargs)
def get_definition(self):
return self.get_parent_until((pr.Statement, pr.IsScope, pr.Import))
return self.get_parent_until((pr.ExprStmt, pr.IsScope, pr.Import))
def get_decorated_func(self):
""" Needed because the InstanceElement should not be stripped """

View File

@@ -1515,7 +1515,7 @@ class Name(Simple):
def get_definition(self):
# TODO This is way to complicated, simplify this with a new parser.
return self.get_parent_until((Statement, IsScope, Import))
return self.get_parent_until((ExprStmt, IsScope, Import))
@property
def end_pos(self):