class Temple::Filters::StaticMerger
[:static, “Hello World!”]]
[:multi,
Compiles to:
[:static, “World!”]]
[:static, “Hello ”],
[:multi,
Merges several statics into a single static. Example:
def on_multi(*exps)
def on_multi(*exps) res = [:multi] curr = nil state = :looking exps.each do |exp| if exp.first == :static if state == :looking res << [:static, (curr = exp[1].dup)] state = :static else curr << exp[1] end else res << compile!(exp) state = :looking unless exp.first == :newline end end res end