MCPcopy Create free account
hub / github.com/WasmVM/WasmVM / parse_globaltype

Method parse_globaltype

src/lib/parse/ParseContext.cpp:250–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250GlobalType ParseContext::parse_globaltype() {
251 GlobalType gt;
252 if (tok_.peek().type == TokenType::LParen &&
253 tok_.peek2().type == TokenType::Keyword && tok_.peek2().text == "mut") {
254 tok_.consume(); tok_.consume(); // '(' 'mut'
255 gt.mut = GlobalType::variable;
256 gt.type = parse_valtype();
257 tok_.expect(TokenType::RParen);
258 } else {
259 gt.mut = GlobalType::constant;
260 gt.type = parse_valtype();
261 }
262 return gt;
263}
264
265// ── Typeuse ───────────────────────────────────────────────────────────────────
266

Callers

nothing calls this directly

Calls 3

peekMethod · 0.80
expectMethod · 0.80
consumeMethod · 0.45

Tested by

no test coverage detected