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 17, 2015
1 parent abb11c4 commit 5f2f3db
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 5f2f3db

Please sign in to comment.