forked from VimPlug/jedi
Few fixes to the nodes_to_execute logic.
This commit is contained in:
@@ -722,10 +722,10 @@ class Class(ClassOrFunc):
|
|||||||
|
|
||||||
def get_super_arglist(self):
|
def get_super_arglist(self):
|
||||||
if self.children[2] != '(': # Has no parentheses
|
if self.children[2] != '(': # Has no parentheses
|
||||||
return None
|
return []
|
||||||
else:
|
else:
|
||||||
if self.children[3] == ')': # Empty parentheses
|
if self.children[3] == ')': # Empty parentheses
|
||||||
return None
|
return []
|
||||||
else:
|
else:
|
||||||
return self.children[3]
|
return self.children[3]
|
||||||
|
|
||||||
@@ -744,12 +744,14 @@ class Class(ClassOrFunc):
|
|||||||
def nodes_to_execute(self, last_added=False):
|
def nodes_to_execute(self, last_added=False):
|
||||||
# Yield itself, class needs to be executed for decorator checks.
|
# Yield itself, class needs to be executed for decorator checks.
|
||||||
yield self
|
yield self
|
||||||
for param in self.get_super_arglist:
|
# Super arguments.
|
||||||
if param.default is None:
|
for args in self.get_super_arglist:
|
||||||
yield param.default
|
if args.type == 'args':
|
||||||
else:
|
# metaclass= or list comprehension or */**
|
||||||
# metaclass=
|
|
||||||
raise NotImplementedError('Metaclasses not implemented')
|
raise NotImplementedError('Metaclasses not implemented')
|
||||||
|
else:
|
||||||
|
yield args
|
||||||
|
|
||||||
# care for the class suite:
|
# care for the class suite:
|
||||||
for node_to_execute in self.children[-1].nodes_to_execute():
|
for node_to_execute in self.children[-1].nodes_to_execute():
|
||||||
yield node_to_execute
|
yield node_to_execute
|
||||||
@@ -1226,6 +1228,12 @@ class YieldExpr(BaseNode):
|
|||||||
def type(self):
|
def type(self):
|
||||||
return 'yield_expr'
|
return 'yield_expr'
|
||||||
|
|
||||||
|
def nodes_to_execute(self, last_added=False):
|
||||||
|
if len(self.children) > 1:
|
||||||
|
return self.children[1].nodes_to_execute()
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
def _defined_names(current):
|
def _defined_names(current):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user