diff options
Diffstat (limited to 'test/example')
-rw-r--r-- | test/example/module-splitting.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/example/module-splitting.cpp b/test/example/module-splitting.cpp index cb3df4e78..3f74c252c 100644 --- a/test/example/module-splitting.cpp +++ b/test/example/module-splitting.cpp @@ -3,6 +3,7 @@ #include "ir/module-splitting.h" #include "ir/stack-utils.h" +#include "parser/wat-parser.h" #include "wasm-features.h" #include "wasm-s-parser.h" #include "wasm-validator.h" @@ -13,13 +14,9 @@ using namespace wasm; std::unique_ptr<Module> parse(char* module) { auto wasm = std::make_unique<Module>(); wasm->features = FeatureSet::All; - try { - SExpressionParser parser(module); - Element& root = *parser.root; - SExpressionWasmBuilder builder(*wasm, *root[0], IRProfile::Normal); - } catch (ParseException& p) { - p.dump(std::cerr); - Fatal() << "error in parsing wasm text"; + auto parsed = WATParser::parseModule(*wasm, module); + if (auto* err = parsed.getErr()) { + Fatal() << err->msg << "\n"; } return wasm; } |