class Sass::Engine
def import(files)
def import(files) nodes = [] files.split(/,\s*/).each do |filename| engine = nil begin filename = self.class.find_file_to_import(filename, @options[:load_paths]) rescue Exception => e raise SyntaxError.new(e.message, @line) end if filename =~ /\.css$/ nodes << Tree::DirectiveNode.new("@import url(#{filename})", @options[:style]) else File.open(filename) do |file| new_options = @options.dup new_options[:filename] = filename engine = Sass::Engine.new(file.read, @options) end engine.constants.merge! @constants engine.mixins.merge! @mixins begin root = engine.render_to_tree rescue Sass::SyntaxError => err err.add_backtrace_entry(filename) raise err end root.children.each do |child| child.filename = filename nodes << child end @constants = engine.constants @mixins = engine.mixins end end nodes end