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

Method match_identifier

cranelift/reader/src/parser.rs:554–560  ·  view source on GitHub ↗

Match and consume a specific identifier string. Used for pseudo-keywords like "stack_slot" that only appear in certain contexts.

(&mut self, want: &'static str, err_msg: &str)

Source from the content-addressed store, hash-verified

552 // Match and consume a specific identifier string.
553 // Used for pseudo-keywords like "stack_slot" that only appear in certain contexts.
554 fn match_identifier(&mut self, want: &'static str, err_msg: &str) -> ParseResult<Token<'a>> {
555 if self.token() == Some(Token::Identifier(want)) {
556 Ok(self.consume())
557 } else {
558 err!(self.loc, err_msg)
559 }
560 }
561
562 // Match and consume a type.
563 fn match_type(&mut self, err_msg: &str) -> ParseResult<Type> {

Callers 1

parse_functionMethod · 0.80

Calls 3

OkFunction · 0.85
tokenMethod · 0.80
consumeMethod · 0.45

Tested by

no test coverage detected