Skip to content

Commit 253a4ca

Browse files
committed
Merge pull request #1870 from mgreter/revert/error-check-for-extend
Disable error check for extend placement check
2 parents 1c92e8f + abdf613 commit 253a4ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parser.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ namespace Sass {
221221
}
222222

223223
else if (lex < kwd_extend >(true)) {
224-
if (block->is_root()) {
224+
Scope parent = stack.empty() ? Scope::Rules : stack.back();
225+
if (parent == Scope::Root) {
225226
error("Extend directives may only be used within rules.", pstate);
226227
}
227228

@@ -2131,6 +2132,7 @@ namespace Sass {
21312132
Block* body = 0;
21322133
At_Root_Expression* expr = 0;
21332134
Lookahead lookahead_result;
2135+
// stack.push_back(Scope::Root);
21342136
LOCAL_FLAG(in_at_root, true);
21352137
if (lex< exactly<'('> >()) {
21362138
expr = parse_at_root_expression();
@@ -2145,6 +2147,7 @@ namespace Sass {
21452147
}
21462148
At_Root_Block* at_root = SASS_MEMORY_NEW(ctx.mem, At_Root_Block, at_source_position, body);
21472149
if (expr) at_root->expression(expr);
2150+
// stack.pop_back();
21482151
return at_root;
21492152
}
21502153

0 commit comments

Comments
 (0)