(&mut self)
| 490 | } |
| 491 | |
| 492 | fn parse_params(&mut self) -> Option<Vec<Ident>> { |
| 493 | let mut idents: Vec<Ident> = vec![]; |
| 494 | if self.peek_token(&Token::RightParen) { |
| 495 | self.next_token(); |
| 496 | return Some(idents); |
| 497 | } |
| 498 | |
| 499 | self.next_token(); |
| 500 | match self.current_token { |
| 501 | Token::Ident(ref mut ident) => idents.push(Ident(ident.clone())), |
| 502 | _ => { |
| 503 | self.errors.push( |
| 504 | format!("Meow! Expected a purr-ameter identifier. Got: {} 🙀", self.current_token) |
| 505 | ); |
| 506 | return None; |
| 507 | } |
| 508 | }; |
| 509 | |
| 510 | while self.peek_token(&Token::Comma) { |
| 511 | self.next_token(); |
| 512 | self.next_token(); |
| 513 | match self.current_token { |
| 514 | Token::Ident(ref mut ident) => idents.push(Ident(ident.clone())), |
| 515 | _ => return None, |
| 516 | }; |
| 517 | } |
| 518 | |
| 519 | if !self.expect_peek(Token::RightParen) { |
| 520 | return None; |
| 521 | } |
| 522 | |
| 523 | Some(idents) |
| 524 | } |
| 525 | |
| 526 | fn parse_call_arguments(&mut self) -> Option<Vec<Expr>> { |
| 527 | let mut args: Vec<Expr> = vec![]; |
no test coverage detected