class Mustache::Template
def self.recursor(toks, section, &block)
def self.recursor(toks, section, &block) toks.map do |token| next unless token.is_a? Array if token.first == :mustache new_token, new_section, result, stop = yield(token, section) [ result ] + ( stop ? [] : recursor(new_token, new_section, &block)) else recursor(token, section, &block) end end end