Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 48917b7

Browse files
author
Aaron Leung
committed
Allowing directives and stuff inside namespaced properties.
1 parent 7e0c0f3 commit 48917b7

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

document_parser.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,18 @@ namespace Sass {
308308
property_segment = context.new_Node(Node::identifier, path, line, lexed);
309309
}
310310
lex< exactly<':'> >();
311-
lex< exactly<'{'> >();
312-
Node block(context.new_Node(Node::block, path, line, 1));
313-
while (!lex< exactly<'}'> >()) {
314-
if (peek< sequence< optional< exactly<'*'> >, alternatives< identifier_schema, identifier >, optional_spaces, exactly<':'>, optional_spaces, exactly<'{'> > >(position)) {
315-
block << parse_propset();
316-
}
317-
else {
318-
block << parse_rule();
319-
lex< exactly<';'> >();
320-
}
321-
}
311+
Node block(parse_block(Node()));
312+
// lex< exactly<'{'> >();
313+
// Node block(context.new_Node(Node::block, path, line, 1));
314+
// while (!lex< exactly<'}'> >()) {
315+
// if (peek< sequence< optional< exactly<'*'> >, alternatives< identifier_schema, identifier >, optional_spaces, exactly<':'>, optional_spaces, exactly<'{'> > >(position)) {
316+
// block << parse_propset();
317+
// }
318+
// else {
319+
// block << parse_rule();
320+
// lex< exactly<';'> >();
321+
// }
322+
// }
322323
if (block.empty()) throw_syntax_error("namespaced property cannot be empty");
323324
Node propset(context.new_Node(Node::propset, path, line, 2));
324325
propset << property_segment;

node_emitters.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,12 @@ namespace Sass {
729729
// has_prefix = true;
730730
}
731731
Node rules(at(1));
732+
rules.flatten();
732733
for (size_t i = 0, S = rules.size(); i < S; ++i) {
733734
if (rules[i].type() == propset) {
734735
rules[i].emit_propset(buf, depth+1, new_prefix, compressed);
735736
}
736-
else {
737+
else if (rules[i].type() == rule) {
737738
buf << new_prefix;
738739
if (rules[i][0].to_string() != "") buf << '-';
739740
if (!compressed) {

0 commit comments

Comments
 (0)