Closed
Description
I'm working on parsing media queries, and my understanding is that the syntax specifies that a media feature must end with a )
[1].
For example, if you have the string "(width", Parser::parse_nested_block
will return Ok(_)
. And there is no easy way to determine how if it was closed by a )
or EOF, as far as I can see.
#[test]
fn block_closed_by_delimiter() {
let mut input = Parser::new("(width");
assert!(input.expect_parenthesis_block().is_ok());
let result = input.parse_nested_block(|input| {
assert!(input.expect_ident_matching("width").is_ok());
assert!(input.is_exhausted());
Ok(true)
});
assert!(result.is_err());
}
1: http://drafts.csswg.org/mediaqueries/#typedef-media-feature
<media-feature> = ( [ <mf-plain> | <mf-boolean> | <mf-range> ] )
Metadata
Metadata
Assignees
Labels
No labels