1
0
forked from VimPlug/jedi

get rid of is_list_comp boolean in favor of a direct check of ListComprehensionFlow

This commit is contained in:
Dave Halter
2014-06-09 20:19:31 +02:00
parent dd8e4341db
commit 0b926ca454
7 changed files with 17 additions and 21 deletions

View File

@@ -497,3 +497,13 @@ def create_indexes_or_slices(evaluator, index_array):
return (Slice(evaluator, start, stop, step),)
else:
return tuple(evaluator.process_precedence_element(prec))
class ListComprehensionFlow(pr.ForFlow):
"""Fake implementation to pretend being a ForFlow."""
def __init__(self, list_comprehension, input, parent):
lc = list_comprehension
sup = super(ListComprehensionFlow, self)
sup.__init__(helpers.FakeSubModule, [input], lc.parent.start_pos, lc.middle)
self.parent = parent or lc.get_parent_until(pr.IsScope)
self.list_comprehension = list_comprehension