Commit 66f27795 by Aaron Leung

Allowing calls to non-Sass functions to pass through. Apparently this is allowed.

parent aba60c5c
...@@ -655,13 +655,13 @@ namespace Sass { ...@@ -655,13 +655,13 @@ namespace Sass {
if (!lex< exactly<')'> >()) syntax_error("unclosed parenthesis"); if (!lex< exactly<')'> >()) syntax_error("unclosed parenthesis");
return value; return value;
} }
else if (lex< exactly<'+'> >()) { else if (lex< sequence< exactly<'+'>, negate< number > > >()) {
Node plus(Node::unary_plus, context.registry, line_number, 1); Node plus(Node::unary_plus, context.registry, line_number, 1);
plus << parse_factor(); plus << parse_factor();
plus.eval_me = true; plus.eval_me = true;
return plus; return plus;
} }
else if (lex< exactly<'-'> >()) { else if (lex< sequence< exactly<'-'>, negate< number> > >()) {
Node minus(Node::unary_minus, context.registry, line_number, 1); Node minus(Node::unary_minus, context.registry, line_number, 1);
minus << parse_factor(); minus << parse_factor();
minus.eval_me = true; minus.eval_me = true;
......
...@@ -216,9 +216,10 @@ namespace Sass { ...@@ -216,9 +216,10 @@ namespace Sass {
// TO DO: default-constructed Function should be a generic callback // TO DO: default-constructed Function should be a generic callback
pair<string, size_t> sig(expr[0].content.token.to_string(), expr[1].size()); pair<string, size_t> sig(expr[0].content.token.to_string(), expr[1].size());
if (!f_env.count(sig)) { if (!f_env.count(sig)) {
stringstream ss; // stringstream ss;
ss << "no function named " << expr[0].content.token.to_string() << " taking " << expr[1].size() << " arguments has been defined"; // ss << "no function named " << expr[0].content.token.to_string() << " taking " << expr[1].size() << " arguments has been defined";
eval_error(ss.str(), expr.line_number, expr.file_name); // eval_error(ss.str(), expr.line_number, expr.file_name);
return expr;
} }
return apply_function(f_env[sig], expr[1], env, f_env, registry); return apply_function(f_env[sig], expr[1], env, f_env, registry);
} break; } break;
......
...@@ -174,6 +174,27 @@ namespace Sass { ...@@ -174,6 +174,27 @@ namespace Sass {
return "/"; return "/";
} break; } break;
case function_call: {
stringstream ss;
ss << at(0).to_string("");
ss << "(";
ss << at(1).to_string("");
ss << ")";
return ss.str();
}
case arguments: {
stringstream ss;
if (size() > 0) {
ss << at(0).to_string("");
for (int i = 1; i < size(); ++i) {
ss << ", ";
ss << at(i).to_string("");
}
}
return ss.str();
}
case unary_plus: { case unary_plus: {
stringstream ss; stringstream ss;
ss << "+"; ss << "+";
......
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