MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / parse_opt_block_call_args

Method parse_opt_block_call_args

cranelift/reader/src/parser.rs:2462–2480  ·  view source on GitHub ↗

Parse an optional list of block-call arguments enclosed in parentheses.

(&mut self)

Source from the content-addressed store, hash-verified

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() {

Callers 3

parse_jump_tableMethod · 0.80
parse_exception_tableMethod · 0.80
parse_inst_operandsMethod · 0.80

Calls 7

OkFunction · 0.85
optionalMethod · 0.80
tokenMethod · 0.80
parse_block_call_argMethod · 0.80
match_tokenMethod · 0.80
pushMethod · 0.45
consumeMethod · 0.45

Tested by

no test coverage detected