class Temple::Filters::MultiFlattener
def compile(exp)
def compile(exp) exp.first == :multi ? on_multi(*exp[1..-1]) : exp end
def initialize(options = {})
def initialize(options = {}) @options = {} end
def on_multi(*exps)
def on_multi(*exps) # If the multi contains a single element, just return the element return compile(exps.first) if exps.length == 1 result = [:multi] exps.each do |exp| exp = compile(exp) if exp.first == :multi result.concat(exp[1..-1]) else result << exp end end result end