Open funkybob opened 9 years ago
We can move the burden of updating the context from for
to block
potentially... this would mean pushing locals() into the scope stack around the yield from.
If we scan the blocks of code in each call to Parser.build_method we can write the function to accept the args it needs, and \ context.
However, we would also need to track all block calls so we pass these variables onto them.
Would also require for tags, and anything else, to (temporarily) update this list.
Instead of mangling Name nodes to become context lookups, we can promote values out of the context into the local scope for mind bogglingly fast lookups.
We'd have to be careful of any nested scopes, like "with".
Also make sure to fall back to the global scope properly.