Commit c60e12c2 by Aaron Leung

Parsing function calls.

parent 8360fd9c
...@@ -112,7 +112,7 @@ namespace Sass { ...@@ -112,7 +112,7 @@ namespace Sass {
Node parse_mixin_parameters(); Node parse_mixin_parameters();
Node parse_parameter(); Node parse_parameter();
Node parse_mixin_call(); Node parse_mixin_call();
Node parse_mixin_arguments(); Node parse_arguments();
Node parse_argument(); Node parse_argument();
Node parse_assignment(); Node parse_assignment();
Node parse_ruleset(bool definition = false); Node parse_ruleset(bool definition = false);
...@@ -135,6 +135,7 @@ namespace Sass { ...@@ -135,6 +135,7 @@ namespace Sass {
Node parse_value(); Node parse_value();
Node parse_identifier(); Node parse_identifier();
Node parse_variable(); Node parse_variable();
Node parse_function_call();
const char* look_for_rule(const char* start = 0); const char* look_for_rule(const char* start = 0);
const char* look_for_values(const char* start = 0); const char* look_for_values(const char* start = 0);
......
...@@ -94,13 +94,13 @@ namespace Sass { ...@@ -94,13 +94,13 @@ namespace Sass {
lex< include >(); lex< include >();
lex< identifier >(); lex< identifier >();
Node name(Node::identifier, line_number, lexed); Node name(Node::identifier, line_number, lexed);
Node args(parse_mixin_arguments()); Node args(parse_arguments());
Node call(Node::expansion, line_number, 3); Node call(Node::expansion, line_number, 3);
call << name << args; call << name << args;
return call; return call;
} }
Node Document::parse_mixin_arguments() Node Document::parse_arguments()
{ {
Node args(Node::arguments, line_number); Node args(Node::arguments, line_number);
if (lex< exactly<'('> >()) { if (lex< exactly<'('> >()) {
...@@ -539,6 +539,9 @@ namespace Sass { ...@@ -539,6 +539,9 @@ namespace Sass {
return result; return result;
} }
if (peek< functional >())
{ return parse_function_call(); }
if (lex< identifier >()) if (lex< identifier >())
{ return Node(Node::identifier, line_number, lexed); } { return Node(Node::identifier, line_number, lexed); }
...@@ -565,6 +568,16 @@ namespace Sass { ...@@ -565,6 +568,16 @@ namespace Sass {
} }
} }
Node Document::parse_function_call()
{
lex< identifier >();
Node name(Node::identifier, line_number, lexed);
Node args(parse_arguments());
Node call(Node::function_call, line_number, 2);
call << name << args;
return call;
}
Node Document::parse_identifier() { Node Document::parse_identifier() {
lex< identifier >(); lex< identifier >();
return Node(Node::identifier, line_number, lexed); return Node(Node::identifier, line_number, lexed);
......
...@@ -63,6 +63,7 @@ namespace Sass { ...@@ -63,6 +63,7 @@ namespace Sass {
number, number,
numeric_color, numeric_color,
function_call,
mixin, mixin,
parameters, parameters,
expansion, expansion,
......
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