# File lib/sass/tree/visitors/check_nesting.rb, line 77
  def invalid_import_parent?(parent, child)
    if is_any_of?(@real_parent, INVALID_IMPORT_PARENTS)
      return "Import directives may not be used within control directives or mixins."
    end
    return if parent.is_a?(Sass::Tree::RootNode)
    return "CSS import directives may only be used at the root of a document." if child.css_import?
    # If this is a nested @import, we need to make sure it doesn't have anything
    # that's legal at top-level but not in the current context (e.g. mixin defs).
    child.imported_file.to_tree.children.each {|c| visit(c)}
    nil
  rescue Sass::SyntaxError => e
    e.modify_backtrace(:filename => child.imported_file.options[:filename])
    e.add_backtrace(:filename => child.filename, :line => child.line)
    raise e
  end