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

Method is_declaration_start

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

Source from the content-addressed store, hash-verified

1707
1708 Ok(Type::Named {
1709 name: Path::from_segments(segments),
1710 args,
1711 })
1712 }
1713 Some(Token::LBrace) => self.parse_struct_type(),
1714 Some(Token::LParen) => self.parse_function_pointer_type(),
1715 Some(tok) => Err(self.error_with_token("expected type", tok)),
1716 None => Err(self.error("unexpected end of input while parsing type")),
1717 }
1718 }
1719
1720 fn parse_function_pointer_type(&mut self) -> Result<Type, ParserError> {
1721 self.expect_lparen()?;
1722 let mut params = Vec::new();
1723 self.consume_terminators();
1724 if !self.check_rparen() {
1725 loop {
1726 params.push(self.parse_type()?);
1727 self.consume_terminators();

Callers 1

parse_programMethod · 0.80

Calls 2

peekMethod · 0.80
peek_nMethod · 0.80

Tested by

no test coverage detected