Commit ba8709ad by Aaron Leung

Getting arbitrarily nested empty rule-less blocks emitting correctly in expanded-style mode.

parent 13f04721
div {
span {
color: red;
background: blue;
}
}
div {
color: gray;
empty {
span {
color: red;
background: blue;
}
}
}
empty1 {
empty2 {
div {
blah: blah;
}
}
}
empty1 {
empty2 {
div {
bloo: blee;
empty3 {
span {
blah: blah;
blah: blah;
}
}
}
}
}
......@@ -151,9 +151,11 @@ namespace Sass {
opt_children[i].emit_expanded_css(buf, prefix);
break;
case ruleset:
buf << prefix;
if (children[1].children.size() > 0)
children[0].emit_expanded_css(buf, prefix);
// buf << prefix;
if (children[1].children.size() > 0) {
buf << prefix << (prefix.empty() ? "" : " ");
children[0].emit_expanded_css(buf, "");
}
string newprefix(prefix.empty() ? prefix : prefix + " ");
children[1].emit_expanded_css(buf, newprefix + string(children[0].token));
break;
......
......@@ -13,11 +13,11 @@ int main(int argc, char* argv[]) {
Document doc(argv[1], 0);
doc.parse_scss();
// string output = doc.emit_css(doc.expanded);
// cout << output;
// cout << endl;
string output = doc.emit_css(doc.nested);
string output = doc.emit_css(doc.expanded);
cout << output;
cout << endl;
// string output = doc.emit_css(doc.nested);
// cout << output;
return 0;
}
\ No newline at end of file
......@@ -35,4 +35,13 @@ div {
}
}
/* last comment, top level again --
compare the indentation! */
\ No newline at end of file
compare the indentation! */
div {
f: g;
empty {
span {
a: b;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment