Commit 7de279c8 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Visit genexp if conditions during scoping analysis

parent 6b2c893e
......@@ -407,6 +407,8 @@ public:
for (AST_comprehension* c : node->generators) {
if (!first)
c->iter->accept(this);
for (auto i : c->ifs)
i->accept(this);
c->target->accept(this);
first = false;
}
......
......@@ -15,3 +15,10 @@ def f2():
print list(g2)
f2()
# Make sure that the 'ifs' part gets scoped properly
def f3():
b = True
print list(x for x in range(5) if b)
print list(x for x in range(5) if [b for b in xrange(4)])
print b
print f3()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment