MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / parse_for_statement

Method parse_for_statement

crates/hll-to-ir/src/parser.rs:603–630  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

601 self.expect_lbrace()?;
602 self.consume_terminators();
603
604 let mut methods = Vec::new();
605 let mut consts = Vec::new();
606 let mut aliases = Vec::new();
607 while !self.check_rbrace() {
608 if matches!(self.peek(), Some(Token::Const)) {
609 self.advance();
610 let name = self.expect_ident()?;
611 self.expect_assign()?;
612 consts.push((name, self.parse_expression()?));
613 self.consume_terminators();
614 continue;
615 }
616 if matches!(self.peek(), Some(Token::Type)) {
617 self.advance();
618 let name = self.expect_ident()?;
619 self.expect_assign()?;
620 aliases.push((name, self.parse_type()?));
621 self.consume_terminators();
622 continue;
623 }
624 let DeclNode::Function {
625 name,
626 generics,
627 bounds,
628 params,
629 return_type,
630 body,
631 ..
632 } = self.parse_function_decl(false, false)?
633 else {

Callers 1

parse_statementMethod · 0.80

Calls 8

expect_forMethod · 0.80
expect_identMethod · 0.80
match_inMethod · 0.80
parse_expressionMethod · 0.80
match_dot_dot_eqMethod · 0.80
match_dot_dotMethod · 0.80
parse_blockMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected