MCPcopy Create free account
hub / github.com/PerroEngine/Perro / expect_scene_key

Method expect_scene_key

perro_source/runtime_project/perro_scene/src/parser.rs:63–77  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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

Callers 2

parse_scene_innerMethod · 0.80

Calls 4

extendMethod · 0.80
advanceMethod · 0.45
expect_identMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected