Commit f99b3c6b by Aaron Leung

Foundations of value schemas (i.e., embedded interpolants).

parent f8627553
......@@ -670,7 +670,13 @@ namespace Sass {
return result;
}
if (lex< true_kwd >())
if (lex< value_schema >())
{
// TO DO: handle value schemas!
return Node(Node::identifier, line_number, lexed);
}
if (lex< sequence< true_kwd, negate< identifier > > >())
{
Node T(Node::boolean);
T.line_number = line_number;
......@@ -678,7 +684,7 @@ namespace Sass {
return T;
}
if (lex< false_kwd >())
if (lex< sequence< false_kwd, negate< identifier > > >())
{
Node F(Node::boolean);
F.line_number = line_number;
......
......@@ -2,5 +2,10 @@ $x: bar;
div {
a: blah foo#{$x};
b: 1 + 123#{a b @fuzzle};
b: (1#{2+3}) + 4;
b: (1 (2+3)) + 4;
c: 1#{2 + 3} + 4;
d: type-of(false);
e: type-of(fa#{lse});
e: 12fa#{lse}345;
}
\ No newline at end of file
......@@ -79,6 +79,15 @@ namespace Sass {
exactly<'-'>,
exactly<'_'> > > >(src);
}
// Match interpolant schemas
const char* value_schema(const char* src) {
// follows this pattern: ([xyz]*i[xyz]*)+
return one_plus< sequence< zero_plus< alternatives< identifier, number > >,
interpolant,
zero_plus< alternatives< identifier, number > > > >(src);
}
// Match CSS '@' keywords.
const char* at_keyword(const char* src) {
return sequence<exactly<'@'>, identifier>(src);
......
......@@ -274,6 +274,8 @@ namespace Sass {
// Match a CSS identifier.
const char* identifier(const char* src);
// Match interpolant schemas
const char* value_schema(const char* src);
// Match CSS '@' keywords.
const char* at_keyword(const char* src);
const char* import(const char* src);
......
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