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

Method match_token

cranelift/reader/src/parser.rs:534–540  ·  view source on GitHub ↗

Match and consume a token without payload.

(&mut self, want: Token<'a>, err_msg: &str)

Source from the content-addressed store, hash-verified

532
533 // Match and consume a token without payload.
534 fn match_token(&mut self, want: Token<'a>, err_msg: &str) -> ParseResult<Token<'a>> {
535 if self.token() == Some(want) {
536 Ok(self.consume())
537 } else {
538 err!(self.loc, err_msg)
539 }
540 }
541
542 // If the next token is a `want`, consume it, otherwise do nothing.
543 fn optional(&mut self, want: Token<'a>) -> bool {

Callers 15

match_uimm128Method · 0.80
optional_debug_tagsMethod · 0.80
parse_functionMethod · 0.80
parse_signatureMethod · 0.80
parse_abi_paramMethod · 0.80
parse_stack_slot_declMethod · 0.80
parse_signature_declMethod · 0.80
parse_function_declMethod · 0.80
parse_jump_tableMethod · 0.80

Calls 3

OkFunction · 0.85
tokenMethod · 0.80
consumeMethod · 0.45

Tested by

no test coverage detected