class Sass::Script::Tree::Interpolation

def concat(string_or_interp1, string_or_interp2)

Returns:
  • (Sass::Script::Tree::StringInterpolation) -

Parameters:
  • string_or_interp2 (Sass::Script::Tree::Literal|Sass::Script::Tree::StringInterpolation) --
  • string_or_interp1 (Sass::Script::Tree::Literal|Sass::Script::Tree::StringInterpolation) --
def concat(string_or_interp1, string_or_interp2)
  if string_or_interp1.is_a?(Literal) && string_or_interp2.is_a?(Literal)
    return string_literal(string_or_interp1.value.value + string_or_interp2.value.value)
  end
  if string_or_interp1.is_a?(Literal)
    string = string_or_interp1
    interp = string_or_interp2
    before = string_literal(string.value.value + interp.before.value.value)
    return StringInterpolation.new(before, interp.mid, interp.after)
  end
  StringInterpolation.new(
    string_or_interp1.before,
    string_or_interp1.mid,
    concat(string_or_interp1.after, string_or_interp2))
end