Parse an optional list of block-call arguments enclosed in parentheses.
(&mut self)
| 2460 | /// Parse an optional list of block-call arguments enclosed in |
| 2461 | /// parentheses. |
| 2462 | fn parse_opt_block_call_args(&mut self) -> ParseResult<Vec<BlockArg>> { |
| 2463 | if !self.optional(Token::LPar) { |
| 2464 | return Ok(vec![]); |
| 2465 | } |
| 2466 | |
| 2467 | let mut args = vec![]; |
| 2468 | while self.token() != Some(Token::RPar) { |
| 2469 | args.push(self.parse_block_call_arg()?); |
| 2470 | if self.token() == Some(Token::Comma) { |
| 2471 | self.consume(); |
| 2472 | } else { |
| 2473 | break; |
| 2474 | } |
| 2475 | } |
| 2476 | |
| 2477 | self.match_token(Token::RPar, "expected ')' after arguments")?; |
| 2478 | |
| 2479 | Ok(args) |
| 2480 | } |
| 2481 | |
| 2482 | fn parse_block_call_arg(&mut self) -> ParseResult<BlockArg> { |
| 2483 | match self.token() { |
no test coverage detected