Commit 3e5e6bfd by Aaron Leung

One step closer to getting nested expansion nodes to emit correctly.

parent c54a6913
...@@ -233,6 +233,7 @@ namespace Sass { ...@@ -233,6 +233,7 @@ namespace Sass {
{ {
// cerr << "APPLYING MIXIN: " << string(mixin[0].token) << endl; // cerr << "APPLYING MIXIN: " << string(mixin[0].token) << endl;
Node params(mixin[1]); Node params(mixin[1]);
if (mixin[2].has_expansions) cerr << "ORIGINAL BODY FOR " << string(mixin[0].token) << " HAS EXPANSIONS" << endl;
Node body(mixin[2].clone()); Node body(mixin[2].clone());
Environment m_env; Environment m_env;
// cerr << "CLONED BODY" << endl; // cerr << "CLONED BODY" << endl;
...@@ -270,6 +271,7 @@ namespace Sass { ...@@ -270,6 +271,7 @@ namespace Sass {
for (int i = 0; i < body.size(); ++i) { for (int i = 0; i < body.size(); ++i) {
body[i] = eval(body[i], m_env); body[i] = eval(body[i], m_env);
} }
if (body.has_expansions) cerr << "APPLYING MIXIN CONTAINING EXPANSIONS" << endl;
return body; return body;
} }
} }
\ No newline at end of file
...@@ -25,6 +25,7 @@ namespace Sass { ...@@ -25,6 +25,7 @@ namespace Sass {
n.has_rules_or_comments = has_rules_or_comments; n.has_rules_or_comments = has_rules_or_comments;
n.has_rulesets = has_rulesets; n.has_rulesets = has_rulesets;
n.has_propsets = has_propsets; n.has_propsets = has_propsets;
n.has_expansions = has_expansions;
n.has_backref = has_backref; n.has_backref = has_backref;
n.from_variable = from_variable; n.from_variable = from_variable;
n.eval_me = eval_me; n.eval_me = eval_me;
...@@ -436,9 +437,11 @@ namespace Sass { ...@@ -436,9 +437,11 @@ namespace Sass {
void Node::flatten() void Node::flatten()
{ {
cerr << "FLATTENING A BLOCK" << endl;
if (type != block && type != expansion) return; if (type != block && type != expansion) return;
for (int i = 0; i < size(); ++i) { for (int i = 0; i < size(); ++i) {
if (at(i).type == expansion) { if (at(i).type == expansion) {
cerr << "FLATTEN: found an expansion node" << endl;
Node expn = at(i); Node expn = at(i);
if (expn.has_expansions) expn.flatten(); if (expn.has_expansions) expn.flatten();
at(i).type = none; at(i).type = none;
......
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