handle toplevel closing curly brace
This commit is contained in:
parent
a3548b0044
commit
eca952b201
@ -332,14 +332,15 @@ impl<'a> StyleSheetParser<'a> {
|
||||
.into())
|
||||
}
|
||||
c if c.is_control() => {
|
||||
return Err(("expected selector.", self.lexer.next().unwrap().pos()).into());
|
||||
return Err(("expected selector.", self.lexer.next().unwrap().pos).into());
|
||||
}
|
||||
',' | '!' | '{' => {
|
||||
return Err(("expected \"{\".", self.lexer.next().unwrap().pos()).into());
|
||||
return Err(("expected \"{\".", self.lexer.next().unwrap().pos).into());
|
||||
}
|
||||
'`' | '\'' | '"' => {
|
||||
return Err(("expected selector.", self.lexer.next().unwrap().pos()).into());
|
||||
return Err(("expected selector.", self.lexer.next().unwrap().pos).into());
|
||||
}
|
||||
'}' => return Err(("unmatched \"}\".", self.lexer.next().unwrap().pos).into()),
|
||||
_ => todo!("unexpected toplevel token: {:?}", kind),
|
||||
};
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ error!(
|
||||
"#{", "Error: expected \"}\"."
|
||||
);
|
||||
error!(toplevel_hash, "#", "Error: expected \"{\".");
|
||||
error!(toplevel_closing_brace, "}", "Error: unmatched \"}\".");
|
||||
error!(toplevel_at, "@", "Error: Expected identifier.");
|
||||
error!(
|
||||
toplevel_ampersand,
|
||||
|
Loading…
x
Reference in New Issue
Block a user