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

Method parse_instr

src/lib/parse/instr_parse.cpp:15–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13// ── Instruction dispatch ──────────────────────────────────────────────────────
14
15std::vector<WasmInstr> ParseContext::parse_instr() {
16 if (tok_.peek().type == TokenType::LParen)
17 return parse_foldedinstr();
18 if (tok_.peek().type == TokenType::Keyword) {
19 std::string kw = tok_.peek().text;
20 if (kw == "block" || kw == "loop" || kw == "if" || kw == "try_table")
21 return parse_blockinstr(kw);
22 }
23 return {parse_plaininstr()};
24}
25
26WasmInstr ParseContext::parse_plaininstr() {
27 Token kw = tok_.expect(TokenType::Keyword, "instruction");

Callers

nothing calls this directly

Calls 1

peekMethod · 0.80

Tested by

no test coverage detected