Commit f677bbc2 by Aaron Leung

Basic mixin functionality. Still need to properly implement environment lookup…

Basic mixin functionality. Still need to properly implement environment lookup and correct indentation.
parent a9c08780
...@@ -35,8 +35,15 @@ namespace Sass { ...@@ -35,8 +35,15 @@ namespace Sass {
} }
} break; } break;
case Node::mixin: {
context.environment[n[0].token] = n;
} break;
case Node::expansion: { case Node::expansion: {
Node body(context.environment[n[0].token][2].clone());
n.children->pop_back();
n.children->pop_back();
n += body;
} break; } break;
} }
} }
......
...@@ -213,10 +213,10 @@ namespace Sass { ...@@ -213,10 +213,10 @@ namespace Sass {
return result; return result;
} break; } break;
case expansion: { // case expansion: {
string result("MIXIN CALL: "); // string result("MIXIN CALL: ");
return result; // return result;
} break; // } break;
default: { default: {
return string(token); return string(token);
...@@ -326,7 +326,7 @@ namespace Sass { ...@@ -326,7 +326,7 @@ namespace Sass {
block[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 == expansion) { else if (stm_type == expansion) {
buf << endl << string(2*(depth+1), ' ') << block[i].to_string(""); // TEMPORARY // buf << string(2*(depth+1), ' ') << block[i].to_string(""); // TEMPORARY
for (int j = 0; j < block[i].size(); ++j) { for (int j = 0; j < block[i].size(); ++j) {
block[i][j].emit_nested_css(buf, depth+1); block[i][j].emit_nested_css(buf, depth+1);
} }
......
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