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

Method match_constant

cranelift/reader/src/parser.rs:644–652  ·  view source on GitHub ↗

Match and consume a constant reference.

(&mut self)

Source from the content-addressed store, hash-verified

642
643 // Match and consume a constant reference.
644 fn match_constant(&mut self) -> ParseResult<Constant> {
645 if let Some(Token::Constant(c)) = self.token() {
646 self.consume();
647 if let Some(c) = Constant::with_number(c) {
648 return Ok(c);
649 }
650 }
651 err!(self.loc, "expected constant number: const«n»")
652 }
653
654 // Match and consume a stack limit token
655 fn match_stack_limit(&mut self) -> ParseResult<()> {

Callers 2

parse_constant_declMethod · 0.80
parse_inst_operandsMethod · 0.80

Calls 3

OkFunction · 0.85
tokenMethod · 0.80
consumeMethod · 0.45

Tested by

no test coverage detected