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

Method match_imm64

cranelift/reader/src/parser.rs:692–701  ·  view source on GitHub ↗

Match and consume an Imm64 immediate.

(&mut self, err_msg: &str)

Source from the content-addressed store, hash-verified

690
691 // Match and consume an Imm64 immediate.
692 fn match_imm64(&mut self, err_msg: &str) -> ParseResult<Imm64> {
693 if let Some(Token::Integer(text)) = self.token() {
694 self.consume();
695 // Lexer just gives us raw text that looks like an integer.
696 // Parse it as an Imm64 to check for overflow and other issues.
697 text.parse().map_err(|e| self.error(e))
698 } else {
699 err!(self.loc, err_msg)
700 }
701 }
702
703 // Match and consume a hexadeximal immediate
704 fn match_hexadecimal_constant(&mut self, err_msg: &str) -> ParseResult<ConstantData> {

Callers 5

parse_stack_slot_declMethod · 0.80
parse_data_valueMethod · 0.80
parse_inst_operandsMethod · 0.80
parse_as_imm64Function · 0.80

Calls 4

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

Tested by

no test coverage detected