Changes for 3.8: sync_comp_for instead of comp_for

Please also look at the changes for parso in its b5d50392a4058919c0018666cdfc8c3eaaea9cb5 commit
This commit is contained in:
Dave Halter
2019-06-09 18:05:34 +02:00
parent f3364a458c
commit 42b6e20729
8 changed files with 48 additions and 25 deletions
+4 -1
View File
@@ -233,10 +233,13 @@ class TreeArguments(AbstractArguments):
named_args.append((c[0].value, LazyTreeContext(self.context, c[2]),))
else: # Generator comprehension.
# Include the brackets with the parent.
sync_comp_for = el.children[1]
if sync_comp_for.type == 'comp_for':
sync_comp_for = sync_comp_for.children[1]
comp = iterable.GeneratorComprehension(
self._evaluator,
defining_context=self.context,
comp_for_node=el.children[1],
sync_comp_for_node=sync_comp_for,
entry_node=el.children[0],
)
yield None, LazyKnownContext(comp)