diff --git a/src/ast.hpp b/src/ast.hpp index 329312f28e..80e2d8c578 100644 --- a/src/ast.hpp +++ b/src/ast.hpp @@ -2118,7 +2118,10 @@ namespace Sass { Compound_Selector* h = 0, Complex_Selector* t = 0, String* r = 0) - : Selector(pstate), combinator_(c), head_(h), tail_(t), reference_(r) + : Selector(pstate), + combinator_(c), + head_(h), tail_(t), + reference_(r) { if ((h && h->has_reference()) || (t && t->has_reference())) has_reference(true); if ((h && h->has_placeholder()) || (t && t->has_placeholder())) has_placeholder(true); diff --git a/src/debugger.hpp b/src/debugger.hpp index 02f6aecfa3..76e4049c57 100644 --- a/src/debugger.hpp +++ b/src/debugger.hpp @@ -71,7 +71,8 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env) std::cerr << " (" << pstate_source_position(node) << ")"; std::cerr << " " << root_block->tabs(); std::cerr << std::endl; - if (root_block->block()) for(auto i : root_block->block()->elements()) { debug_ast(i, ind + " ", env); } + debug_ast(root_block->expression(), ind + ":", env); + debug_ast(root_block->block(), ind + " ", env); } else if (dynamic_cast(node)) { Selector_List* selector = dynamic_cast(node); std::cerr << ind << "Selector_List " << selector; diff --git a/src/expand.cpp b/src/expand.cpp index a485462db5..7673257247 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -625,11 +625,18 @@ namespace Sass { Env* env = environment(); // convert @content directives into mixin calls to the underlying thunk if (!env->has("@content[m]")) return 0; + if (block_stack.back()->is_root()) { + selector_stack.push_back(0); + } Mixin_Call* call = SASS_MEMORY_NEW(ctx.mem, Mixin_Call, c->pstate(), "@content", SASS_MEMORY_NEW(ctx.mem, Arguments, c->pstate())); - return call->perform(this); + Statement* stm = call->perform(this); + if (block_stack.back()->is_root()) { + selector_stack.pop_back(); + } + return stm; } // produce an error if something is not implemented