def extract_interpolated_values(text) # rubocop:disable Metrics/AbcSize
      dumped_text = text.dump
      newline_positions = extract_substring_positions(dumped_text, '\\\n')

      Haml::Util.handle_interpolation(dumped_text) do |scan|
        line = (newline_positions.find_index { |marker| scan.pos <= marker } ||
                newline_positions.size) + 1

        escape_count = (scan[2].size - 1) / 2
        break unless escape_count.even?

        dumped_interpolated_str = Haml::Util.balance(scan, '{', '}', 1)[0][0...-1]

        # Hacky way to turn a dumped string back into a regular string
        yield [eval('"' + dumped_interpolated_str + '"'), line] # rubocop:disable Eval
      end
    end
def extract_interpolated_values(text) # rubocop:disable Metrics/AbcSize
      dumped_text = text.dump
      newline_positions = extract_substring_positions(dumped_text, '\\\n')

      Haml::Util.handle_interpolation(dumped_text) do |scan|
        line = (newline_positions.find_index { |marker| scan.pos <= marker } ||
                newline_positions.size) + 1

        escape_count = (scan[2].size - 1) / 2
        break unless escape_count.even?

        dumped_interpolated_str = Haml::Util.balance(scan, '{', '}', 1)[0][0...-1]

        # Hacky way to turn a dumped string back into a regular string
        yield [eval('"' + dumped_interpolated_str + '"'), line] # rubocop:disable Eval
      end
    end
Yields interpolated values within a block of text.

 @param text [String]
 @yield Passes interpolated code and line number that code appears on in
   the text.
 @yieldparam interpolated_code [String] code that was interpolated
 @yieldparam line [Integer] line number code appears on in text