mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-15 18:17:07 +08:00
Make it possible to get previous statements of Calls.
This commit is contained in:
@@ -1286,11 +1286,12 @@ class Param(ExprStmt):
|
|||||||
|
|
||||||
|
|
||||||
class StatementElement(Simple):
|
class StatementElement(Simple):
|
||||||
__slots__ = ('next',)
|
__slots__ = ('next', 'previous')
|
||||||
|
|
||||||
def __init__(self, module, start_pos, end_pos, parent):
|
def __init__(self, module, start_pos, end_pos, parent):
|
||||||
super(StatementElement, self).__init__(module, start_pos, end_pos, parent)
|
super(StatementElement, self).__init__(module, start_pos, end_pos, parent)
|
||||||
self.next = None
|
self.next = None
|
||||||
|
self.previous = None
|
||||||
|
|
||||||
def set_next(self, call):
|
def set_next(self, call):
|
||||||
""" Adds another part of the statement"""
|
""" Adds another part of the statement"""
|
||||||
@@ -1299,6 +1300,7 @@ class StatementElement(Simple):
|
|||||||
self.next.set_next(call)
|
self.next.set_next(call)
|
||||||
else:
|
else:
|
||||||
self.next = call
|
self.next = call
|
||||||
|
call.previous = self
|
||||||
|
|
||||||
def next_is_execution(self):
|
def next_is_execution(self):
|
||||||
return Array.is_type(self.next, Array.TUPLE, Array.NOARRAY)
|
return Array.is_type(self.next, Array.TUPLE, Array.NOARRAY)
|
||||||
|
|||||||
Reference in New Issue
Block a user