Skip to content

Commit 4e5472e

Browse files
committed
Add parsing error for empty declaration value
Fixes #945
1 parent dc7484c commit 4e5472e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

parser.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,13 @@ namespace Sass {
954954
return new (ctx.mem) Declaration(prop->pstate(), prop, parse_static_value()/*, lex<important>()*/);
955955
}
956956
else {
957-
return new (ctx.mem) Declaration(prop->pstate(), prop, parse_list()/*, lex<important>()*/);
957+
Expression* list_ex = parse_list();
958+
if (List* list = dynamic_cast<List*>(list_ex)) {
959+
if (list->length() == 0 && !peek< exactly <'{'> >()) {
960+
css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ");
961+
}
962+
}
963+
return new (ctx.mem) Declaration(prop->pstate(), prop, list_ex/*, lex<important>()*/);
958964
}
959965
}
960966

0 commit comments

Comments
 (0)