mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Thread ParseError return values through CSS parsing.
This commit is contained in:
parent
58e39bfffa
commit
27ae1ef2e7
121 changed files with 2133 additions and 1505 deletions
|
@ -171,9 +171,13 @@ macro_rules! __define_css_keyword_enum__actual {
|
|||
|
||||
impl $name {
|
||||
/// Parse this property from a CSS input stream.
|
||||
pub fn parse(input: &mut ::cssparser::Parser) -> Result<$name, ()> {
|
||||
pub fn parse<'i, 't>(input: &mut ::cssparser::Parser<'i, 't>)
|
||||
-> Result<$name, $crate::ParseError<'i>> {
|
||||
let ident = input.expect_ident()?;
|
||||
Self::from_ident(&ident)
|
||||
.map_err(|()| ::cssparser::ParseError::Basic(
|
||||
::cssparser::BasicParseError::UnexpectedToken(
|
||||
::cssparser::Token::Ident(ident))))
|
||||
}
|
||||
|
||||
/// Parse this property from an already-tokenized identifier.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue