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 {
}
} break;
case Node::expansion: {
case Node::mixin: {
context.environment[n[0].token] = n;
} break;
case Node::expansion: {
Node body(context.environment[n[0].token][2].clone());
n.children->pop_back();
n.children->pop_back();
n += body;
} break;
}
}
......
......@@ -213,10 +213,10 @@ namespace Sass {
return result;
} break;
case expansion: {
string result("MIXIN CALL: ");
return result;
} break;
// case expansion: {
// string result("MIXIN CALL: ");
// return result;
// } break;
default: {
return string(token);
......@@ -326,7 +326,7 @@ namespace Sass {
block[i].emit_nested_css(buf, depth+1); // NEED OVERLOADED VERSION FOR COMMENTS AND RULES
}
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) {
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