Skip to content

Commit

Permalink
Improve At_Rule parsing (with interpolations)
Browse files Browse the repository at this point in the history
Fixes sass#1263
  • Loading branch information
mgreter committed Jun 30, 2015
1 parent 33ad827 commit de642d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 2 additions & 7 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2056,13 +2056,8 @@ namespace Sass {
string kwd(lexed);
At_Rule* at_rule = new (ctx.mem) At_Rule(pstate, kwd);
Lookahead lookahead = lookahead_for_include(position);
if (lookahead.found) {
if (lookahead.has_interpolants) {
at_rule->selector(parse_selector_schema(lookahead.found));
}
else {
at_rule->selector(parse_selector_list());
}
if (lookahead.found && !lookahead.has_interpolants) {
at_rule->selector(parse_selector_list());
}

lex < css_comments >();
Expand Down
4 changes: 3 additions & 1 deletion util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,9 @@ namespace Sass {
bool hasPrintableChildBlocks = false;
for (size_t i = 0, L = b->length(); i < L; ++i) {
Statement* stm = (*b)[i];
if (dynamic_cast<Has_Block*>(stm)) {
if (dynamic_cast<At_Rule*>(stm)) {
return true;
} else if (dynamic_cast<Has_Block*>(stm)) {
Block* pChildBlock = ((Has_Block*)stm)->block();
if (isPrintable(pChildBlock, style)) {
hasPrintableChildBlocks = true;
Expand Down

0 comments on commit de642d6

Please sign in to comment.