mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
PropertyDeclarationParseResult -> Result<(), PropertyDeclarationParseError>
This commit is contained in:
parent
da6316fbe3
commit
7455ad5eb4
5 changed files with 30 additions and 45 deletions
|
@ -561,8 +561,8 @@ pub fn parse_one_declaration(id: PropertyId,
|
|||
Parser::new(input).parse_entirely(|parser| {
|
||||
let mut results = vec![];
|
||||
match PropertyDeclaration::parse(id, &context, parser, &mut results, false) {
|
||||
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(results),
|
||||
_ => Err(())
|
||||
Ok(()) => Ok(results),
|
||||
Err(_) => Err(())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -592,10 +592,8 @@ impl<'a, 'b> DeclarationParser for PropertyDeclarationParser<'a, 'b> {
|
|||
let id = try!(PropertyId::parse(name.into()));
|
||||
let old_len = self.declarations.len();
|
||||
let parse_result = input.parse_until_before(Delimiter::Bang, |input| {
|
||||
match PropertyDeclaration::parse(id, self.context, input, &mut self.declarations, false) {
|
||||
PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(()),
|
||||
_ => Err(())
|
||||
}
|
||||
PropertyDeclaration::parse(id, self.context, input, &mut self.declarations, false)
|
||||
.map_err(|_| ())
|
||||
});
|
||||
if let Err(_) = parse_result {
|
||||
// rollback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue