Skip to content

Commit 4832eae

Browse files
committed
Merge pull request #1921 from xzyfer/fix/custome-import-order
Fix import resolution order changing with custom importers
2 parents 2acba9d + 4b1fe1b commit 4832eae

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/debugger.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
357357
Import_Stub* block = dynamic_cast<Import_Stub*>(node);
358358
std::cerr << ind << "Import_Stub " << block;
359359
std::cerr << " (" << pstate_source_position(node) << ")";
360+
std::cerr << " [" << block->imp_path() << "] ";
360361
std::cerr << " " << block->tabs() << std::endl;
361362
} else if (dynamic_cast<Import*>(node)) {
362363
Import* block = dynamic_cast<Import*>(node);

src/parser.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,7 @@ namespace Sass {
290290
do {
291291
while (lex< block_comment >());
292292
if (lex< quoted_string >()) {
293-
if (!ctx.call_importers(unquote(std::string(lexed)), path, pstate, imp))
294-
{
295-
// push single file import
296-
// import_single_file(imp, lexed);
297-
to_import.push_back(std::pair<std::string,Function_Call*>(std::string(lexed), 0));
298-
}
293+
to_import.push_back(std::pair<std::string,Function_Call*>(std::string(lexed), 0));
299294
}
300295
else if (lex< uri_prefix >()) {
301296
Arguments* args = SASS_MEMORY_NEW(ctx.mem, Arguments, pstate);
@@ -333,7 +328,7 @@ namespace Sass {
333328
for(auto location : to_import) {
334329
if (location.second) {
335330
imp->urls().push_back(location.second);
336-
} else {
331+
} else if (!ctx.call_importers(unquote(location.first), path, pstate, imp)) {
337332
ctx.import_url(imp, location.first, path);
338333
}
339334
}

0 commit comments

Comments
 (0)