| 31 | |
| 32 | impl<'a> Parse<'a> for LayerName<'a> { |
| 33 | fn parse<I>(p: &mut Parser<'a, I>) -> ParserResult<Self> |
| 34 | where |
| 35 | I: Iterator<Item = Cursor> + Clone, |
| 36 | { |
| 37 | let mut parts = Vec::new_in(p.bump()); |
| 38 | let first = p.parse::<T![Ident]>()?; |
| 39 | loop { |
| 40 | if p.peek::<T![.]>() { |
| 41 | let dot = p.parse::<T![.]>()?; |
| 42 | let ident = p.parse::<T![Ident]>()?; |
| 43 | parts.push((dot, ident)); |
| 44 | } else { |
| 45 | return Ok(Self(first, parts)); |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | #[derive(Parse, Peek, ToCursors, ToSpan, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] |