Sha256: d1b2ebf737b7d67b2705a4598b23a1c8ed4a55c139d236a287a9cf189fb5a1d0
Contents?: true
Size: 690 Bytes
Versions: 7
Compression:
Stored size: 690 Bytes
Contents
# frozen_string_literal: true module Temple module Filters # @api public class CodeMerger < Filter def on_multi(*exps) result = [:multi] code = nil exps.each do |exp| if exp.first == :code if code code << '; ' unless code =~ /\n\Z/ code << exp.last else code = exp.last.dup result << [:code, code] end elsif code && exp.first == :newline code << "\n" else result << compile(exp) code = nil end end result.size == 2 ? result[1] : result end end end end
Version data entries
7 entries across 7 versions & 2 rubygems