class Sass::Engine

def validate_and_append_child(parent, child)

def validate_and_append_child(parent, child)
  case child
  when :constant
    raise SyntaxError.new("Constants may only be declared at the root of a document.", @line)
  when :mixin
    raise SyntaxError.new("Mixins may only be defined at the root of a document.", @line)
  when Array
    child.each do |c|
      if c.is_a?(Tree::DirectiveNode)
        raise SyntaxError.new("Import directives may only be used at the root of a document.", @line)
      end
      parent << c
    end
  when Tree::Node
    parent << child
  end
end