# File lib/sass/tree/visitors/to_css.rb, line 121
  def visit_root(node)
    node.children.each do |child|
      next if child.invisible?
      visit(child)
      next if node.style == :compressed
      output "\n"
      next unless child.is_a?(Sass::Tree::DirectiveNode) && child.has_children && !child.bubbles?
      output "\n"
    end
    rstrip!
    if node.style == :compressed && trailing_semicolon?
      erase! 1
    end
    return "" if @result.empty?

    output "\n"

    unless Sass::Util.ruby1_8? || @result.ascii_only?
      if node.style == :compressed
        # A byte order mark is sufficient to tell browsers that this
        # file is UTF-8 encoded, and will override any other detection
        # methods as per http://encoding.spec.whatwg.org/#decode-and-encode.
        prepend! "\uFEFF"
      else
        prepend! "@charset \"UTF-8\";\n"
      end
    end

    @result
  rescue Sass::SyntaxError => e
    e.sass_template ||= node.template
    raise e
  end