handle ! at toplevel

This commit is contained in:
ConnorSkees 2020-05-21 01:01:02 -04:00
parent c1ed4b3121
commit 28d5fdf636
2 changed files with 5 additions and 1 deletions

View File

@ -295,7 +295,7 @@ impl<'a> StyleSheetParser<'a> {
c if c.is_control() => {
return Err(("expected selector.", self.lexer.next().unwrap().pos()).into());
}
',' => {
',' | '!' => {
return Err(("expected \"{\".", self.lexer.next().unwrap().pos()).into());
}
_ => todo!("unexpected toplevel token: {:?}", kind),

View File

@ -86,3 +86,7 @@ error!(
toplevel_comma,
"a {},", "Error: expected \"{\"."
);
error!(
toplevel_exclamation,
"! {}", "Error: expected \"{\"."
);