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

Method match_enum

cranelift/reader/src/parser.rs:892–899  ·  view source on GitHub ↗

Match and consume an enumerated immediate, like one of the condition codes.

(&mut self, err_msg: &str)

Source from the content-addressed store, hash-verified

890
891 // Match and consume an enumerated immediate, like one of the condition codes.
892 fn match_enum<T: FromStr>(&mut self, err_msg: &str) -> ParseResult<T> {
893 if let Some(Token::Identifier(text)) = self.token() {
894 self.consume();
895 text.parse().map_err(|_| self.error(err_msg))
896 } else {
897 err!(self.loc, err_msg)
898 }
899 }
900
901 // Match and a consume a possibly empty sequence of memory operation flags.
902 fn optional_memflags(&mut self) -> ParseResult<MemFlagsData> {

Callers 3

parse_stack_slot_declMethod · 0.80
parse_inst_operandsMethod · 0.80

Calls 4

tokenMethod · 0.80
consumeMethod · 0.45
parseMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected