Inverse should really be its own node, as it has totally different runtime semantics

This commit is contained in:
wycats
2010-12-03 01:10:14 -05:00
parent 8f6f3051e6
commit c89ecf80a5
4 changed files with 31 additions and 8 deletions
+8 -3
View File
@@ -55,8 +55,13 @@ describe "Parser" do
with_padding { yield }
end
def block(inverse = false)
inverse ? pad("INVERSE:") : pad("BLOCK:")
def block
pad("BLOCK:")
with_padding { yield }
end
def inverted_block
pad("INVERSE:")
with_padding { yield }
end
@@ -150,7 +155,7 @@ describe "Parser" do
it "parses a standalone inverse section" do
ast_for("{{^foo}}bar{{/baz}}").should == program do
block true do
inverted_block do
mustache id("foo")
program do