mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use nested parsers as appropritate
This commit is contained in:
parent
5fb6acb753
commit
7bcf9f0c9a
1 changed files with 12 additions and 4 deletions
|
@ -46,14 +46,18 @@ fn parse_declaration_value(input: &mut Parser, references: &mut HashSet<Atom>) -
|
|||
}
|
||||
|
||||
Token::Function(ref name) if name == "var" => {
|
||||
try!(parse_var_function(input, references));
|
||||
try!(input.parse_nested_block(|input| {
|
||||
parse_var_function(input, references)
|
||||
}));
|
||||
}
|
||||
|
||||
Token::Function(_) |
|
||||
Token::ParenthesisBlock |
|
||||
Token::CurlyBracketBlock |
|
||||
Token::SquareBracketBlock => {
|
||||
try!(parse_declaration_value_block(input, references))
|
||||
try!(input.parse_nested_block(|input| {
|
||||
parse_declaration_value_block(input, references)
|
||||
}));
|
||||
}
|
||||
|
||||
_ => {}
|
||||
|
@ -77,14 +81,18 @@ fn parse_declaration_value_block(input: &mut Parser, references: &mut HashSet<At
|
|||
}
|
||||
|
||||
Token::Function(ref name) if name == "var" => {
|
||||
try!(parse_var_function(input, references));
|
||||
try!(input.parse_nested_block(|input| {
|
||||
parse_var_function(input, references)
|
||||
}));
|
||||
}
|
||||
|
||||
Token::Function(_) |
|
||||
Token::ParenthesisBlock |
|
||||
Token::CurlyBracketBlock |
|
||||
Token::SquareBracketBlock => {
|
||||
try!(parse_declaration_value_block(input, references))
|
||||
try!(input.parse_nested_block(|input| {
|
||||
parse_declaration_value_block(input, references)
|
||||
}));
|
||||
}
|
||||
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue