diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-29 19:47:40 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-29 22:16:58 -0800 |
commit | 782b708984d38fdcd2191f65236227cf6ea11702 (patch) | |
tree | 11f3bb289f32c87442fd68b7e8c3a9a0df09d21d /src/wasm-s-parser.h | |
parent | 50223b341b38c35034821250683635d1fd6a4f76 (diff) | |
download | binaryen-782b708984d38fdcd2191f65236227cf6ea11702.tar.gz binaryen-782b708984d38fdcd2191f65236227cf6ea11702.tar.bz2 binaryen-782b708984d38fdcd2191f65236227cf6ea11702.zip |
add some s-parser debugging
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r-- | src/wasm-s-parser.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 4817fdf48..f204d933a 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -223,10 +223,11 @@ class SExpressionWasmBuilder { std::function<void ()> onError; int functionCounter; std::map<Name, WasmType> functionTypes; // we need to know function return types before we parse their contents + bool debug; public: // Assumes control of and modifies the input. - SExpressionWasmBuilder(AllocatingModule& wasm, Element& module, std::function<void ()> onError) : wasm(wasm), allocator(wasm.allocator), onError(onError) { + SExpressionWasmBuilder(AllocatingModule& wasm, Element& module, std::function<void ()> onError, bool debug=false) : wasm(wasm), allocator(wasm.allocator), onError(onError), debug(debug) { assert(module[0]->str() == MODULE); functionCounter = 0; for (unsigned i = 1; i < module.size(); i++) { @@ -410,7 +411,7 @@ public: #define abort_on(str) { std::cerr << "aborting on " << str << '\n'; onError(); } Expression* parseExpression(Element& s) { - //std::cerr << "parse expression " << s << '\n'; + if (debug) std::cerr << "parse expression " << s << '\n'; IString id = s[0]->str(); const char *str = id.str; const char *dot = strchr(str, '.'); |