| 2288 | } |
| 2289 | |
| 2290 | Result WastParser::ParseInstr(ExprList* exprs) { |
| 2291 | WABT_TRACE(ParseInstr); |
| 2292 | if (IsPlainInstr(Peek())) { |
| 2293 | std::unique_ptr<Expr> expr; |
| 2294 | CHECK_RESULT(ParsePlainInstr(&expr)); |
| 2295 | exprs->push_back(std::move(expr)); |
| 2296 | return Result::Ok; |
| 2297 | } else if (IsBlockInstr(Peek())) { |
| 2298 | std::unique_ptr<Expr> expr; |
| 2299 | CHECK_RESULT(ParseBlockInstr(&expr)); |
| 2300 | exprs->push_back(std::move(expr)); |
| 2301 | return Result::Ok; |
| 2302 | } else if (PeekMatchExpr()) { |
| 2303 | return ParseExpr(exprs); |
| 2304 | } else { |
| 2305 | assert(!"ParseInstr should only be called when IsInstr() is true"); |
| 2306 | return Result::Error; |
| 2307 | } |
| 2308 | } |
| 2309 | |
| 2310 | Result WastParser::ParseCodeMetadataAnnotation(ExprList* exprs) { |
| 2311 | WABT_TRACE(ParseCodeMetadataAnnotation); |
nothing calls this directly
no test coverage detected