def call(str)
      # Set string encoding if option is set
      if options[:encoding] && str.respond_to?(:encoding)
        old = str.encoding
        str = str.dup if str.frozen?
        str.force_encoding(options[:encoding])
        # Fall back to old encoding if new encoding is invalid
        str.force_encoding(old_enc) unless str.valid_encoding?
      end

      result = [:multi]
      reset(str.split($/), [result])

      while @lines.first && @lines.first =~ /\A\s*\Z/
        @stacks.last << [:newline]
        next_line 
      end
      if @lines.first and @lines.first =~ /\A<doctype\s+([^>]*)>?/i
        if !$'.empty? and $'[0] !~ /\s*#/
          fail("did not expect content after doctype")
        end
        @stacks.last << [:html, :doctype, $1]
        next_line
      end

      parse_line while next_line

      reset
      result
    end
def call(str)
      # Set string encoding if option is set
      if options[:encoding] && str.respond_to?(:encoding)
        old = str.encoding
        str = str.dup if str.frozen?
        str.force_encoding(options[:encoding])
        # Fall back to old encoding if new encoding is invalid
        str.force_encoding(old_enc) unless str.valid_encoding?
      end

      result = [:multi]
      reset(str.split($/), [result])

      while @lines.first && @lines.first =~ /\A\s*\Z/
        @stacks.last << [:newline]
        next_line 
      end
      if @lines.first and @lines.first =~ /\A<doctype\s+([^>]*)>?/i
        if !$'.empty? and $'[0] !~ /\s*#/
          fail("did not expect content after doctype")
        end
        @stacks.last << [:html, :doctype, $1]
        next_line
      end

      parse_line while next_line

      reset
      result
    end
Compile string to Temple expression

 @param [String] str Slim code
 @return [Array] Temple expression representing the code]]