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

Method match_hexadecimal_constant

cranelift/reader/src/parser.rs:704–715  ·  view source on GitHub ↗

Match and consume a hexadeximal immediate

(&mut self, err_msg: &str)

Source from the content-addressed store, hash-verified

702
703 // Match and consume a hexadeximal immediate
704 fn match_hexadecimal_constant(&mut self, err_msg: &str) -> ParseResult<ConstantData> {
705 if let Some(Token::Integer(text)) = self.token() {
706 self.consume();
707 text.parse().map_err(|e| {
708 self.error(&format!(
709 "expected hexadecimal immediate, failed to parse: {e}"
710 ))
711 })
712 } else {
713 err!(self.loc, err_msg)
714 }
715 }
716
717 // Match and consume either a hexadecimal Uimm128 immediate (e.g. 0x000102...) or its literal
718 // list form (e.g. [0 1 2...]). For convenience, since uimm128 values are stored in the

Callers 2

match_uimm128Method · 0.80
parse_constant_declMethod · 0.80

Calls 4

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

Tested by

no test coverage detected