forked from VimPlug/jedi
Fix: CompFor.nodes_to_execute didn't include the right nodes. Sometimes too many, sometimes too few.
This commit is contained in:
@@ -32,6 +32,8 @@ def _start_linter():
|
||||
print(error)
|
||||
except Exception:
|
||||
if '--pdb' in sys.argv:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
import pdb
|
||||
pdb.post_mortem()
|
||||
else:
|
||||
|
||||
@@ -1462,4 +1462,14 @@ class CompFor(BaseNode):
|
||||
return _defined_names(self.children[1])
|
||||
|
||||
def nodes_to_execute(self, last_added=False):
|
||||
return self.children[-1].nodes_to_execute()
|
||||
last = self.children[-1]
|
||||
if last.type == 'comp_if':
|
||||
for node in last.children[-1].nodes_to_execute():
|
||||
yield node
|
||||
last = self.children[-2]
|
||||
elif last.type == 'comp_for':
|
||||
for node in last.nodes_to_execute():
|
||||
yield node
|
||||
last = self.children[-2]
|
||||
for node in last.nodes_to_execute():
|
||||
yield node
|
||||
|
||||
Reference in New Issue
Block a user