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

Method consume_close

perro_source/core/perro_animation/src/anim_tree.rs:462–477  ·  view source on GitHub ↗
(&mut self, expected: &str)

Source from the content-addressed store, hash-verified

460 }
461
462 fn consume_close(&mut self, expected: &str) -> Result<bool, String> {
463 if self.current != Token::LBracket {
464 return Ok(false);
465 }
466 self.advance();
467 if self.current != Token::Slash {
468 return Err(format!("unexpected nested block in [{expected}]"));
469 }
470 self.advance();
471 let end = self.expect_ident()?;
472 self.expect(Token::RBracket)?;
473 if end != expected {
474 return Err(format!("expected [/{expected}], got [/{end}]"));
475 }
476 Ok(true)
477 }
478
479 fn expect(&mut self, token: Token<'a>) -> Result<(), String> {
480 if self.current != token {

Callers 6

parse_header_blockMethod · 0.80
parse_slots_blockMethod · 0.80
parse_output_blockMethod · 0.80
parse_blend_kindMethod · 0.80
parse_add_kindMethod · 0.80
parse_invert_kindMethod · 0.80

Calls 3

advanceMethod · 0.45
expect_identMethod · 0.45
expectMethod · 0.45

Tested by

no test coverage detected