Commit 1878317b by Aaron Leung

Handling more interpolation cases. Don't try to compile this.

parent 7f2d9ae4
...@@ -568,11 +568,15 @@ namespace Sass { ...@@ -568,11 +568,15 @@ namespace Sass {
Node Document::parse_rule() { Node Document::parse_rule() {
Node rule(context.new_Node(Node::rule, path, line, 2)); Node rule(context.new_Node(Node::rule, path, line, 2));
if (!lex< sequence< optional< exactly<'*'> >, identifier > >()) { if (lex< sequence< optional< exactly<'*'> >, identifier > >()) {
lex< spaces_and_comments >(); // get the line number right rule << context.new_Node(node::property, path, line, lexed);
}
else if (peek< sequence< optional< exactly<'*'> >, identifier_schema > >()) {
rule << parse_identifier_schema();
}
else {
throw_syntax_error("invalid property name"); throw_syntax_error("invalid property name");
} }
rule << context.new_Node(Node::property, path, line, lexed);
if (!lex< exactly<':'> >()) throw_syntax_error("property \"" + lexed.to_string() + "\" must be followed by a ':'"); if (!lex< exactly<':'> >()) throw_syntax_error("property \"" + lexed.to_string() + "\" must be followed by a ':'");
rule << parse_list(); rule << parse_list();
return rule; return rule;
...@@ -920,6 +924,19 @@ namespace Sass { ...@@ -920,6 +924,19 @@ namespace Sass {
return schema; return schema;
} }
Node Document::parse_identifier_schema()
{
Node schema(context.new_Node(Node::identifier_schema, path, line, 1));
Token stok(lexed);
while (position < stok.end) {
}
schema.should_eval() = true;
return schema;
}
Node Document::parse_function_call() Node Document::parse_function_call()
{ {
lex< identifier >(); lex< identifier >();
......
...@@ -83,10 +83,10 @@ namespace Sass { ...@@ -83,10 +83,10 @@ namespace Sass {
// Match interpolant schemas // Match interpolant schemas
const char* identifier_schema(const char* src) { const char* identifier_schema(const char* src) {
// follows this pattern: (x*ix*)+ // follows this pattern: (x*ix*)+ ... well, not quite
return one_plus< sequence< zero_plus< identifier >, return one_plus< sequence< zero_plus< identifier >,
interpolant, interpolant,
zero_plus< identifier > > >(src); zero_plus< alternatives< identifier, number, exactly<'-'> > > > >(src);
} }
const char* value_schema(const char* src) { const char* value_schema(const char* src) {
// follows this pattern: ([xyz]*i[xyz]*)+ // follows this pattern: ([xyz]*i[xyz]*)+
......
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