| 384 | } |
| 385 | |
| 386 | fn parse_specified_declaration_value<I>(p: &mut Parser<'a, I>, name: Cursor) -> ParserResult<Self> |
| 387 | where |
| 388 | I: Iterator<Item = Cursor> + Clone, |
| 389 | { |
| 390 | let c = p.peek_n(1); |
| 391 | if c == Kind::Ident { |
| 392 | match p.to_atom::<CssAtomSet>(c) { |
| 393 | CssAtomSet::Initial => return Ok(Self::Initial(p.parse::<T![Ident]>()?)), |
| 394 | CssAtomSet::Inherit => return Ok(Self::Inherit(p.parse::<T![Ident]>()?)), |
| 395 | CssAtomSet::Unset => return Ok(Self::Unset(p.parse::<T![Ident]>()?)), |
| 396 | CssAtomSet::Revert => return Ok(Self::Revert(p.parse::<T![Ident]>()?)), |
| 397 | CssAtomSet::RevertLayer => return Ok(Self::RevertLayer(p.parse::<T![Ident]>()?)), |
| 398 | _ => {} |
| 399 | } |
| 400 | } |
| 401 | macro_rules! parse_declaration_value { |
| 402 | ( $( $name: ident: $ty: ident$(<$a: lifetime>)? = $atom: ident,)+ ) => { |
| 403 | match p.to_atom::<CssAtomSet>(name) { |
| 404 | $(CssAtomSet::$atom => p.parse::<values::$ty>().map(Self::$name),)+ |
| 405 | _ => Err(Diagnostic::new(name, Diagnostic::unexpected))?, |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | apply_properties!(parse_declaration_value) |
| 410 | } |
| 411 | |
| 412 | fn parse_unknown_declaration_value<I>(p: &mut Parser<'a, I>, _name: Cursor) -> ParserResult<Self> |
| 413 | where |