def handle_interpolation(str)
      scan = StringScanner.new(str)
      yield scan while scan.scan(/(.*?)(\\*)#([\{@$])/)
      scan.rest
    end
def handle_interpolation(str)
      scan = StringScanner.new(str)
      yield scan while scan.scan(/(.*?)(\\*)#([\{@$])/)
      scan.rest
    end
Scans through a string looking for the interoplation-opening `#{`
 and, when it's found, yields the scanner to the calling code
 so it can handle it properly.

 The scanner will have any backslashes immediately in front of the `#{`
 as the second capture group (`scan[2]`),
 and the text prior to that as the first (`scan[1]`).

 @yieldparam scan [StringScanner] The scanner scanning through the string
 @return [String] The text remaining in the scanner after all `#{`s have been processed