class Sass::Script::Parser

def interpolation(first: nil, inner: :space)

def interpolation(first: nil, inner: :space)
  e = first || send(inner)
  while (interp = try_tok(:begin_interpolation))
    wb = @lexer.whitespace?(interp)
    char_before = @lexer.char(interp.pos - 1)
    mid = without_stop_at {assert_expr :expr}
    assert_tok :end_interpolation
    wa = @lexer.whitespace?
    char_after = @lexer.char
    after = send(inner)
    before_deprecation = e.is_a?(Script::Tree::Interpolation) ? e.deprecation : :none
    after_deprecation = after.is_a?(Script::Tree::Interpolation) ? after.deprecation : :none
    deprecation =
      if before_deprecation == :immediate || after_deprecation == :immediate ||
         # Warn for #{foo}$var and #{foo}(1) but not #{$foo}1.
         (after && !wa && char_after =~ /[$(]/) ||
         # Warn for $var#{foo} and (a)#{foo} but not a#{foo}.
         (e && !wb && is_unsafe_before?(e, char_before))
        :immediate
      else
        :potential
      end
    e = node(
      Script::Tree::Interpolation.new(e, mid, after, wb, wa, :deprecation => deprecation),
      (e || interp).source_range.start_pos)
  end
  e
end