MCPcopy Create free account
hub / github.com/AlenVelocity/MeowScript / parse_call_arguments

Method parse_call_arguments

src/parser.rs:526–555  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

524 }
525
526 fn parse_call_arguments(&mut self) -> Option<Vec<Expr>> {
527 let mut args: Vec<Expr> = vec![];
528
529 if self.peek_token(&Token::RightParen) {
530 self.next_token();
531 return Some(args);
532 }
533
534 self.next_token();
535 match self.parse_expr(Precedence::Lowest) {
536 Some(e) => args.push(e),
537 None => return None,
538 };
539
540 while self.peek_token(&Token::Comma) {
541 self.next_token();
542 self.next_token();
543
544 match self.parse_expr(Precedence::Lowest) {
545 Some(e) => args.push(e),
546 None => return None,
547 };
548 }
549
550 if !self.expect_peek(Token::RightParen) {
551 return None;
552 }
553
554 Some(args)
555 }
556
557 fn parse_index_expr(&mut self, left: Expr) -> Option<Expr> {
558 self.next_token();

Callers 1

parse_call_exprMethod · 0.80

Calls 4

peek_tokenMethod · 0.80
parse_exprMethod · 0.80
expect_peekMethod · 0.80
next_tokenMethod · 0.45

Tested by

no test coverage detected