Skip to content

Commit d844d2e

Browse files
authored
Remove obsolete parser code (#6607)
Remove `SExpressionParser`, `SExpressionWasmBuilder`, and `cashew::Parser`. Simplify gen-s-parser.py. Remove the --new-wat-parser and --deprecated-wat-parser flags.
1 parent f622b8e commit d844d2e

25 files changed

+607
-9653
lines changed

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ Current Trunk
2828
the PassOptions. As a result `BinaryenModulePrintStackIR` and similar APIs
2929
do not receive an `optimize` flag, as they read the PassOption
3030
`optimizeStackIR` instead.
31-
- The new, standards-compliant text parser is now the default. `wasm-opt` has a
32-
`--deprecated-wat-parser` flag that will switch back to using the old text
33-
parser, but that option will go away soon.
31+
- The new, standards-compliant text parser is now the default.
3432
- Source map comments on `else` branches must now be placed above the
3533
instruction inside the `else` branch rather than on the `else` branch itself.
3634
- Source map locations from instructions are no longer automatically propagated

Contributing.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ Use this handy checklist to make sure your new instructions are fully supported:
1818
- [ ] Interpretation added to src/wasm-interpreter.h
1919
- [ ] Effects handled in src/ir/effects.h
2020
- [ ] Precomputing handled in src/passes/Precompute.cpp
21-
- [ ] Hashing and comparing in src/ir/ExpressionAnalyzer.cpp
22-
- [ ] Parsing added in scripts/gen-s-parser.py, src/wasm-s-parser.h and src/wasm/wasm-s-parser.cpp
21+
- [ ] Parsing added in scripts/gen-s-parser.py, src/parser/parsers.h, src/parser/contexts.h, src/wasm-ir-builder.h, and src/wasm/wasm-ir-builder.cpp
2322
- [ ] Printing added in src/passes/Print.cpp
2423
- [ ] Decoding added in src/wasm-binary.h and src/wasm/wasm-binary.cpp
2524
- [ ] Binary writing added in src/wasm-stack.h and src/wasm/wasm-stack.cpp
@@ -30,4 +29,4 @@ Use this handy checklist to make sure your new instructions are fully supported:
3029
- [ ] C API tested in test/example/c-api-kitchen-sink.c
3130
- [ ] JS API tested in test/binaryen.js/kitchen-sink.js
3231
- [ ] Tests added in test/spec
33-
- [ ] Tests added in top-level test/
32+
- [ ] Tests added in test/lit

check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def run_spec_test(wast):
195195

196196
def run_opt_test(wast):
197197
# check optimization validation
198-
cmd = shared.WASM_OPT + [wast, '-O', '-all', '-q', '--new-wat-parser']
198+
cmd = shared.WASM_OPT + [wast, '-O', '-all', '-q']
199199
support.run_command(cmd)
200200

201201
def check_expected(actual, expected):

scripts/gen-s-parser.py

Lines changed: 598 additions & 617 deletions
Large diffs are not rendered by default.

src/binaryen-c.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "wasm-binary.h"
3232
#include "wasm-builder.h"
3333
#include "wasm-interpreter.h"
34-
#include "wasm-s-parser.h"
3534
#include "wasm-stack.h"
3635
#include "wasm-validator.h"
3736
#include "wasm.h"

src/emscripten-optimizer/parser.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ IString STORE("store");
112112
IString GETTER("get");
113113
IString SETTER("set");
114114

115-
IStringSet
116-
keywords("var const function if else do while for break continue return "
117-
"switch case default throw try catch finally true false null new");
118-
119115
const char *OPERATOR_INITS = "+-*/%<>&^|~=!,?:.", *SEPARATORS = "([;{}";
120116

121117
int MAX_OPERATOR_SIZE = 3;

0 commit comments

Comments
 (0)