This repository was archived by the owner on May 11, 2020. It is now read-only.
Commit 6803234
authored
wast: first import of a wast format scanner+parser
- `tokens.go`: Defines the Token type generated by the scanner and several utility functions around it
- `test.wast`: A .wast test file extracted from [wasm's spec tests](https://github.com/WebAssembly/spec/blob/master/test/core/names.wast)
- `scanner.go`: Implements the actual scanner and utilty functions regarding runes
- `scanner_test.go`: A dead simple test case against the `test.wast` file. It doesn't verify correctness yet.
- Added several new token kind constants to list different typed instructions such as `i64.reinterpret/f64` or `i32.add`
- Implemented the `(*Scanner).scanTypedReserved()` method to identify well and ill-formed typed instructions
- Better Scanner test interface, the test suite now takes a `-wast-file` flag that must point to the `.wast` file to Scan and test against.
In order to test:
- Create (or use a [`spec/test/core`](https://github.com/WebAssembly/spec/tree/master/test/core) ) wast file
Updates #34.1 parent 39e14db commit 6803234
5 files changed
+1115
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments