MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / loadImport

Method loadImport

lib/loader/ast/component/component_import.cpp:9–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace Loader {
8
9Expect<void> Loader::loadImport(AST::Component::Import &Im) {
10 // import ::= in:<importname'> ed:<externdesc> => (import in ed)
11 // importname' ::= 0x00 len:<u32> in:<importname> => in (if len = |in|)
12
13 EXPECTED_TRY(loadExternName(Im.getName()).map_error([this](auto E) {
14 return logLoadError(E, FMgr.getLastOffset(), ASTNodeAttr::Comp_Import);
15 }));
16 EXPECTED_TRY(loadDesc(Im.getDesc()).map_error([](auto E) {
17 spdlog::error(ErrInfo::InfoAST(ASTNodeAttr::Comp_Import));
18 return E;
19 }));
20 return {};
21}
22
23} // namespace Loader
24} // namespace WasmEdge

Callers

nothing calls this directly

Calls 5

InfoASTClass · 0.85
getLastOffsetMethod · 0.80
EXPECTED_TRYFunction · 0.70
errorFunction · 0.50
getNameMethod · 0.45

Tested by

no test coverage detected