Commit acb29562 by Aaron Leung

Even more correct implementation of 'append'.

parent ed0de292
...@@ -505,8 +505,17 @@ namespace Sass { ...@@ -505,8 +505,17 @@ namespace Sass {
Node append_impl(const vector<Token>& parameters, map<Token, Node>& bindings, bool has_sep, Node_Factory& new_Node) { Node append_impl(const vector<Token>& parameters, map<Token, Node>& bindings, bool has_sep, Node_Factory& new_Node) {
Node list(bindings[parameters[0]]); Node list(bindings[parameters[0]]);
if (list.type() != Node::space_list && list.type() != Node::comma_list) { switch (list.type())
{
case Node::space_list:
case Node::comma_list:
case Node::nil: {
// do nothing
} break;
// if the first arg isn't a list, wrap it in a singleton
default: {
list = (new_Node(Node::space_list, list.path(), list.line(), 1) << list); list = (new_Node(Node::space_list, list.path(), list.line(), 1) << list);
} break;
} }
Node::Type sep_type = list.type(); Node::Type sep_type = list.type();
if (has_sep) { if (has_sep) {
...@@ -534,7 +543,6 @@ namespace Sass { ...@@ -534,7 +543,6 @@ namespace Sass {
return append_impl(parameters, bindings, true, new_Node); return append_impl(parameters, bindings, true, new_Node);
} }
// Introspection Functions ///////////////////////////////////////////// // Introspection Functions /////////////////////////////////////////////
extern const char number_name[] = "number"; extern const char number_name[] = "number";
......
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