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

Method parse_slots_block

perro_source/core/perro_animation/src/anim_tree.rs:178–202  ·  view source on GitHub ↗
(&mut self, close_block: &str)

Source from the content-addressed store, hash-verified

176 }
177
178 fn parse_slots_block(&mut self, close_block: &str) -> Result<Vec<AnimationTreeSlot>, String> {
179 let mut slots = Vec::new();
180 loop {
181 if self.consume_close(close_block)? {
182 break;
183 }
184 match &self.current {
185 Token::Ident(v) => {
186 slots.push(AnimationTreeSlot {
187 name: Cow::Owned(v.to_string()),
188 });
189 self.advance();
190 }
191 Token::String(v) => {
192 slots.push(AnimationTreeSlot {
193 name: Cow::Owned(v.clone()),
194 });
195 self.advance();
196 }
197 Token::Comma => self.advance(),
198 other => return Err(format!("expected slot name, got {other:?}")),
199 }
200 }
201 Ok(slots)
202 }
203
204 fn parse_output_block(&mut self) -> Result<Cow<'static, str>, String> {
205 let mut output = Cow::Borrowed("");

Callers 1

parseMethod · 0.80

Calls 4

consume_closeMethod · 0.80
cloneMethod · 0.80
pushMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected