(&mut self)
| 61 | other => Err(format!("Expected identifier, got {:?}", other)), |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | fn expect_scene_key(&mut self) -> ParseResult<Cow<'a, str>> { |
| 66 | let mut at_count = 0; |
| 67 | while self.current == Token::At { |
| 68 | self.advance(); |
| 69 | at_count += 1; |
| 70 | } |
| 71 | let ident = self.expect_ident()?; |
| 72 | if at_count == 0 { |
| 73 | return Ok(Cow::Borrowed(ident)); |
| 74 | } |
| 75 | let mut key = String::with_capacity(at_count + ident.len()); |
| 76 | key.extend(std::iter::repeat_n('@', at_count)); |
| 77 | key.push_str(ident); |
| 78 | Ok(Cow::Owned(key)) |
| 79 | } |
| 80 |
no test coverage detected