Commit bfb7afa2 by Aaron Leung

Working on mixin expansion and emission.

parent a5365756
...@@ -340,10 +340,10 @@ namespace Sass { ...@@ -340,10 +340,10 @@ namespace Sass {
} }
else if (peek< include >(position)) { else if (peek< include >(position)) {
Node call(parse_mixin_call()); Node call(parse_mixin_call());
root << call; block << call;
root.has_rules_or_comments |= call.has_rules_or_comments; block.has_rules_or_comments |= call.has_rules_or_comments;
root.has_rulesets |= call.has_rulesets; block.has_rulesets |= call.has_rulesets;
root.has_propsets |= call.has_propsets; block.has_propsets |= call.has_propsets;
semicolon = true; semicolon = true;
if (!definition) context.pending.push_back(call); if (!definition) context.pending.push_back(call);
} }
......
...@@ -212,6 +212,11 @@ namespace Sass { ...@@ -212,6 +212,11 @@ namespace Sass {
result += ")"; result += ")";
return result; return result;
} break; } break;
case mixin_expansion: {
string result("MIXIN: ");
return result;
} break;
default: { default: {
return string(token); return string(token);
...@@ -315,10 +320,16 @@ namespace Sass { ...@@ -315,10 +320,16 @@ namespace Sass {
buf << ", " << new_prefixes[i]; buf << ", " << new_prefixes[i];
} }
buf << " {"; buf << " {";
for (int i = 0; i < block.children->size(); ++i) { for (int i = 0; i < block.size(); ++i) {
Type stm_type = block.children->at(i).type; Type stm_type = block[i].type;
if (stm_type == comment || stm_type == rule) { if (stm_type == comment || stm_type == rule) {
block.children->at(i).emit_nested_css(buf, depth+1); // NEED OVERLOADED VERSION FOR COMMENTS AND RULES block[i].emit_nested_css(buf, depth+1); // NEED OVERLOADED VERSION FOR COMMENTS AND RULES
}
else if (stm_type == mixin_expansion) {
buf << endl << string(2*(depth+1), ' ') << block[i].to_string(""); // TEMPORARY
for (int j = 0; j < block[i].size(); ++j) {
block[i][j].emit_nested_css(buf, depth+1);
}
} }
} }
buf << " }" << endl; buf << " }" << endl;
......
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