norman/lua-haml — pull request #9 by randrews (2012-05-24 20:29:12+00:00)
Title: Added a __newindex function on to the metatable for Haml environments. 

Before this change, you could put code into tag attributes like this:

%div{:class => "#{tbl.whatever}"}

But this only works if tbl is passed in as a local; that is, this won't work:

- tbl = {whatever='blah'}
%div{:class => "#{tbl.whatever}"}

This works by making the initial assignment to tbl put a new value in locals, instead of a new global value. This has the (IMO) nice side-effect of keeping bad Haml from polluting the global namespace.

Not sure if you actually want to pull this or not; unlike the last one (indentation stuff) this actually changes the semantics. I think it adds a useful feature though; at least it does for my markup. :)