allow = and == in media queries

This commit is contained in:
Connor Skees 2020-08-22 19:18:28 -04:00
parent b03561bc37
commit 605f4f3d6b
2 changed files with 22 additions and 2 deletions

View File

@ -36,10 +36,10 @@ impl<'a> Parser<'a> {
Some(Token { kind: '=', .. }) => { Some(Token { kind: '=', .. }) => {
if matches!(toks.peek_next(), Some(Token { kind: '=', .. })) { if matches!(toks.peek_next(), Some(Token { kind: '=', .. })) {
toks.reset_cursor(); toks.reset_cursor();
true false
} else { } else {
toks.reset_cursor(); toks.reset_cursor();
false true
} }
} }
_ => false, _ => false,

View File

@ -88,6 +88,26 @@ test!(
}", }",
"@media (true) {\n a {\n interpolation: in-parens;\n }\n}\n" "@media (true) {\n a {\n interpolation: in-parens;\n }\n}\n"
); );
test!(
single_eq_in_query,
"@media (height=600px) {
a {
b: c
}
}
",
"@media (height = 600px) {\n a {\n b: c;\n }\n}\n"
);
test!(
double_eq_in_query,
"@media (height==600px) {
a {
b: c
}
}
",
"@media (false) {\n a {\n b: c;\n }\n}\n"
);
error!( error!(
media_feature_missing_closing_paren, media_feature_missing_closing_paren,
"@media foo and (bar:a", "Error: expected \")\"." "@media foo and (bar:a", "Error: expected \")\"."