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

Method parse_param_list

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

Source from the content-addressed store, hash-verified

540
541 Ok(DeclNode::Function {
542 name,
543 generics,
544 bounds,
545 params,
546 return_type,
547 body,
548 is_extern,
549 is_import_interface,
550 })
551 }
552
553 // Parse `interface Name { method: (self: Self*, ...) -> R ... }`: required
554 // method signatures only, with `Self` standing for the implementing type.
555 fn parse_interface_decl(&mut self) -> Result<DeclNode, ParserError> {
556 let name = self.expect_ident()?;
557 self.expect_lbrace()?;
558 self.consume_terminators();
559
560 let mut methods = Vec::new();
561 while !self.check_rbrace() {
562 let method_name = self.expect_ident()?;
563 self.expect_colon()?;
564 let params = self.parse_param_list()?;
565 let return_type = if self.match_arrow() {
566 Some(self.parse_return_type()?)
567 } else {
568 None
569 };
570
571 let receiver_ok = params.first().is_some_and(|receiver| {

Callers 1

parse_function_declMethod · 0.80

Calls 9

expect_lparenMethod · 0.80
match_rparenMethod · 0.80
expect_identMethod · 0.80
expect_colonMethod · 0.80
parse_typeMethod · 0.80
pushMethod · 0.80
match_commaMethod · 0.80
check_rparenMethod · 0.80
expect_rparenMethod · 0.80

Tested by

no test coverage detected