mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Use the ParserContext along with Parser in the parse function
This commit is contained in:
parent
c4f87f451f
commit
dee1a65a69
30 changed files with 318 additions and 285 deletions
|
@ -47,16 +47,16 @@
|
|||
second: None
|
||||
}
|
||||
}
|
||||
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
let first = try!(Side::parse(input));
|
||||
let second = Side::parse(input).ok();
|
||||
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
let first = try!(Side::parse(context, input));
|
||||
let second = Side::parse(context, input).ok();
|
||||
Ok(SpecifiedValue {
|
||||
first: first,
|
||||
second: second,
|
||||
})
|
||||
}
|
||||
impl Parse for Side {
|
||||
fn parse(input: &mut Parser) -> Result<Side, ()> {
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Side, ()> {
|
||||
if let Ok(ident) = input.try(|input| input.expect_ident()) {
|
||||
match_ignore_ascii_case! { ident,
|
||||
"clip" => Ok(Side::Clip),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue