stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.34k stars 223 forks source link

Modify for node, to only pop variables off the context stack, that are actually local to it. #197

Open kaygro opened 6 years ago

kaygro commented 6 years ago

This would not affect vanilla stencil templates, but would enable modifications inside a for loop, that are visible outside of it (as would be very nice to have for the StencilSwiftKit extension). I'll try to make a pull request today for these modifications.

Thers' actually a second option of achievingthe same thing by just modifying the Contexts subscript setter to to work more similar to its getter.

I'll make a pull request for that as well.

kaygro commented 6 years ago

turns out, the second method is incompatible to several existing testcases(even though they are limited to class Context)....so, theres just one pullrequest