Skip to content

Commit 60f8391

Browse files
committed
Fix parsing of @supports declarations
Emulate the parse behaviour of `@media` query declarations. Fixes #2452
1 parent d7a7a58 commit 60f8391

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/parser.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,12 +2448,16 @@ namespace Sass {
24482448
{
24492449
Supports_Condition_Ptr cond;
24502450
// parse something declaration like
2451-
Declaration_Obj declaration = parse_declaration();
2452-
if (!declaration) error("@supports condition expected declaration", pstate);
2451+
Expression_Obj feature = parse_expression();
2452+
Expression_Obj expression = 0;
2453+
if (lex_css< exactly<':'> >()) {
2454+
expression = parse_list(DELAYED);
2455+
}
2456+
if (!feature || !expression) error("@supports condition expected declaration", pstate);
24532457
cond = SASS_MEMORY_NEW(Supports_Declaration,
2454-
declaration->pstate(),
2455-
declaration->property(),
2456-
declaration->value());
2458+
feature->pstate(),
2459+
feature,
2460+
expression);
24572461
// ToDo: maybe we need an additional error condition?
24582462
return cond;
24592463
}

0 commit comments

Comments
 (0)