Skip to content

Commit

Permalink
Add parsing error for empty declaration value
Browse files Browse the repository at this point in the history
Fixes #945
  • Loading branch information
mgreter committed Mar 16, 2015
1 parent 4acacab commit f70adab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,11 @@ namespace Sass {
return new (ctx.mem) Declaration(prop->pstate(), prop, parse_static_value()/*, lex<important>()*/);
}
else {
return new (ctx.mem) Declaration(prop->pstate(), prop, parse_list()/*, lex<important>()*/);
Expression* list_ex = parse_list();
if (List* list = dynamic_cast<List*>(list_ex)) {
if (list->length() == 0) css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ");
}
return new (ctx.mem) Declaration(prop->pstate(), prop, list_ex/*, lex<important>()*/);
}
}

Expand Down

0 comments on commit f70adab

Please sign in to comment.