Skip to content

Commit

Permalink
Fix parsing of @supports declarations
Browse files Browse the repository at this point in the history
Emulate the parse behaviour of `@media` query declarations.

Fixes #2452
  • Loading branch information
xzyfer committed Mar 5, 2018
1 parent d7a7a58 commit 60f8391
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2448,12 +2448,16 @@ namespace Sass {
{
Supports_Condition_Ptr cond;
// parse something declaration like
Declaration_Obj declaration = parse_declaration();
if (!declaration) error("@supports condition expected declaration", pstate);
Expression_Obj feature = parse_expression();
Expression_Obj expression = 0;
if (lex_css< exactly<':'> >()) {
expression = parse_list(DELAYED);
}
if (!feature || !expression) error("@supports condition expected declaration", pstate);
cond = SASS_MEMORY_NEW(Supports_Declaration,
declaration->pstate(),
declaration->property(),
declaration->value());
feature->pstate(),
feature,
expression);
// ToDo: maybe we need an additional error condition?
return cond;
}
Expand Down

0 comments on commit 60f8391

Please sign in to comment.