Commit 780085ea by Aaron Leung

Working on the emitter for arbitrary directives.

parent 5c16dd51
...@@ -378,8 +378,18 @@ namespace Sass { ...@@ -378,8 +378,18 @@ namespace Sass {
buf << " {"; buf << " {";
for (size_t i = 0, S = block.size(); i < S; ++i) { for (size_t i = 0, S = block.size(); i < S; ++i) {
Type stm_type = block[i].type(); Type stm_type = block[i].type();
if (stm_type == comment || stm_type == rule || stm_type == css_import || stm_type == propset || stm_type == warning) { switch (stm_type)
block[i].emit_nested_css(buf, depth+1); {
case comment:
case rule:
case css_import:
case propset:
case block_directive:
case blockless_directive:
case warning: {
block[i].emit_nested_css(buf, depth+1);
} break;
default: break;
} }
} }
buf << " }"; buf << " }";
...@@ -404,6 +414,19 @@ namespace Sass { ...@@ -404,6 +414,19 @@ namespace Sass {
buf << " }" << endl; buf << " }" << endl;
} break; } break;
case blockless_directive: {
buf << endl << string(2*depth, ' ');
buf << to_string();
buf << ";";
} break;
case block_directive: {
buf << string(2*depth, ' ');
buf << at(0).to_string() << " {" << endl;
at(1).emit_nested_css(buf, depth+1, false, false);
buf << " }" << endl;
} break;
case propset: { case propset: {
emit_propset(buf, depth, ""); emit_propset(buf, depth, "");
} break; } break;
......
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