class Sass::CSS

def flatten_rule(rule)

def flatten_rule(rule)
  while rule.children.size == 1 && rule.children.first.is_a?(Tree::RuleNode)
    child = rule.children.first
    if child.rule[0] == ?&
      rule.rule = child.rule.gsub /^&/, rule.rule
    else
      rule.rule = "#{rule.rule} #{child.rule}"
    end
    rule.children = child.children
  end
  flatten_rules(rule)
end