Commit d7502ac1 by Aaron Leung

Fixing legacy stuff; don't need to pass Node handles by reference anymore.

parent 8e9e6bc8
...@@ -17,7 +17,7 @@ namespace Sass { ...@@ -17,7 +17,7 @@ namespace Sass {
throw Error(Error::evaluation, path, line, message); throw Error(Error::evaluation, path, line, message);
} }
Node eval(Node& expr, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& ctx) Node eval(Node expr, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& ctx)
{ {
switch (expr.type()) switch (expr.type())
{ {
...@@ -47,6 +47,9 @@ namespace Sass { ...@@ -47,6 +47,9 @@ namespace Sass {
if (expr[0].type() == Node::selector_schema) { if (expr[0].type() == Node::selector_schema) {
expr[0] = eval(expr[0], env, f_env, new_Node, ctx); expr[0] = eval(expr[0], env, f_env, new_Node, ctx);
} }
// expand the selector right here and stick it in expr[2]
eval(expr[1], env, f_env, new_Node, ctx); eval(expr[1], env, f_env, new_Node, ctx);
return expr; return expr;
} break; } break;
...@@ -286,7 +289,7 @@ namespace Sass { ...@@ -286,7 +289,7 @@ namespace Sass {
return expr; return expr;
} }
Node accumulate(Node::Type op, Node& acc, Node& rhs, Node_Factory& new_Node) Node accumulate(Node::Type op, Node acc, Node rhs, Node_Factory& new_Node)
{ {
Node lhs(acc.back()); Node lhs(acc.back());
double lnum = lhs.numeric_value(); double lnum = lhs.numeric_value();
...@@ -378,7 +381,7 @@ namespace Sass { ...@@ -378,7 +381,7 @@ namespace Sass {
} }
} }
Node apply_mixin(Node& mixin, const Node& args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& ctx) Node apply_mixin(Node mixin, const Node args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& ctx)
{ {
Node params(mixin[1]); Node params(mixin[1]);
Node body(new_Node(mixin[2])); // clone the body Node body(new_Node(mixin[2])); // clone the body
...@@ -434,7 +437,7 @@ namespace Sass { ...@@ -434,7 +437,7 @@ namespace Sass {
return body; return body;
} }
Node apply_function(const Function& f, const Node& args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& ctx) Node apply_function(const Function& f, const Node args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& ctx)
{ {
map<Token, Node> bindings; map<Token, Node> bindings;
// bind arguments // bind arguments
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
namespace Sass { namespace Sass {
using std::map; using std::map;
Node eval(Node& expr, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& src_refs); Node eval(Node expr, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& src_refs);
Node accumulate(Node::Type op, Node& acc, Node& rhs, Node_Factory& new_Node); Node accumulate(Node::Type op, Node acc, Node rhs, Node_Factory& new_Node);
double operate(Node::Type op, double lhs, double rhs); double operate(Node::Type op, double lhs, double rhs);
Node apply_mixin(Node& mixin, const Node& args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& src_refs); Node apply_mixin(Node mixin, const Node args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& src_refs);
Node apply_function(const Function& f, const Node& args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& src_refs); Node apply_function(const Function& f, const Node args, Environment& env, map<pair<string, size_t>, Function>& f_env, Node_Factory& new_Node, Context& src_refs);
} }
\ No newline at end of file
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