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

Method parse_stack_limit_decl

cranelift/reader/src/parser.rs:1981–1998  ·  view source on GitHub ↗

Parse a stack limit decl stack-limit-decl ::= * StackLimit "=" GlobalValue(gv)

(&mut self)

Source from the content-addressed store, hash-verified

1979 //
1980 // stack-limit-decl ::= * StackLimit "=" GlobalValue(gv)
1981 fn parse_stack_limit_decl(&mut self) -> ParseResult<GlobalValue> {
1982 self.match_stack_limit()?;
1983 self.match_token(Token::Equal, "expected '=' in stack limit decl")?;
1984 let limit = match self.token() {
1985 Some(Token::GlobalValue(base_num)) => match GlobalValue::with_number(base_num) {
1986 Some(gv) => gv,
1987 None => return err!(self.loc, "invalid global value number for stack limit"),
1988 },
1989 _ => return err!(self.loc, "expected global value"),
1990 };
1991 self.consume();
1992
1993 // Collect any trailing comments.
1994 self.token();
1995 self.claim_gathered_comments(AnyEntity::StackLimit);
1996
1997 Ok(limit)
1998 }
1999
2000 // Parse a function body, add contents to `ctx`.
2001 //

Callers 1

parse_preambleMethod · 0.80

Calls 6

OkFunction · 0.85
match_stack_limitMethod · 0.80
match_tokenMethod · 0.80
tokenMethod · 0.80
consumeMethod · 0.45

Tested by

no test coverage detected