module Less::StyleSheet::Mixin4

def build_with_sass(env)

def build_with_sass(env)
  selectors.build(env, :mixin).each do |path|
    el = path.inject(env.root) do |current, node|
      current.descend(node.selector, node) or raise MixinNameError, "#{selectors.text_value} in #{env}"
    end
    if el.is_a?(Node::Mixin::Def)
      # Calling a mixin with arguments, which gets compiled to a Sass mixin
      env << Node::Mixin::Call.new(el, [], env)
    else
      # Calling a mixin without arguments, which gets compiled to @extend
      sel = selector_str(path)
      base = selector_str(selector_base(path))
      if base == sel
        env << Node::SassNode.new(Sass::Tree::ExtendNode.new([sel]))
      else
        Haml::Util.haml_warn <<WARNING
G: Sass doesn't support mixing in selector sequences.
ing "#{sel}" with "@extend #{base}"
G
        env << Node::SassNode.new(Sass::Tree::CommentNode.new("// #{sel};", true))
        env << Node::SassNode.new(Sass::Tree::ExtendNode.new([base]))
      end
    end
  end
end