Parse module from file path. See "include/loader/loader.h".
| 165 | |
| 166 | // Parse module from file path. See "include/loader/loader.h". |
| 167 | Expect<std::unique_ptr<AST::Module>> |
| 168 | Loader::parseModule(const std::filesystem::path &FilePath) { |
| 169 | EXPECTED_TRY(auto ComponentOrModule, parseWasmUnit(FilePath)); |
| 170 | if (auto M = std::get_if<std::unique_ptr<AST::Module>>(&ComponentOrModule)) { |
| 171 | return std::move(*M); |
| 172 | } |
| 173 | return Unexpect(ErrCode::Value::MalformedVersion); |
| 174 | } |
| 175 | |
| 176 | // Parse module from byte code. See "include/loader/loader.h". |
| 177 | Expect<std::unique_ptr<AST::Module>> |