(p: &mut Parser<'a, I>)
| 10 | |
| 11 | impl<'a> Parse<'a> for HackMediaFeature { |
| 12 | fn parse<I>(p: &mut Parser<'a, I>) -> ParserResult<Self> |
| 13 | where |
| 14 | I: Iterator<Item = Cursor> + Clone, |
| 15 | { |
| 16 | let open = p.parse::<T!['(']>()?; |
| 17 | let keyword = p.parse::<T![Ident]>()?; |
| 18 | if !p.equals_atom(keyword.into(), &CssAtomSet::MinWidth) { |
| 19 | Err(Diagnostic::new(keyword.into(), Diagnostic::expected_ident))? |
| 20 | } |
| 21 | let colon = p.parse::<T![:]>()?; |
| 22 | let dimension = p.parse::<T![Dimension]>()?; |
| 23 | let c: Cursor = dimension.into(); |
| 24 | let str = p.to_source_cursor(c).source(); |
| 25 | if str != "0\\0" { |
| 26 | Err(Diagnostic::new(c, Diagnostic::unexpected))? |
| 27 | } |
| 28 | let close = p.parse::<T![')']>()?; |
| 29 | Ok(Self::IEBackslashZero(open, keyword, colon, dimension, close)) |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | #[cfg(test)] |
nothing calls this directly
no test coverage detected