Switch from wabt crate to wast (#434)

* Switch lightbeam from `wabt` to `wast`

Switch from a C++-based `*.wat` parser to a Rust-based parser

* Remove unneeded `wabt` dev-dependency from wasmtime-api

* Rewrite `wasmtime-wast` crate with `wast-parser`

This commit moves the `wasmtime-wast` crate off the `wabt` crate on to
the `wast-parser` crate which is a Rust implementation of a `*.wast` and
`*.wat` parser. The intention here is to continue to reduce the amount
of C++ required to build wasmtime!

* Use new `wat` and `wast` crate names
This commit is contained in:
Alex Crichton
2019-10-18 15:25:48 -05:00
committed by Dan Gohman
parent ebef2c6b57
commit 9947bc5209
10 changed files with 236 additions and 456 deletions

View File

@@ -20,8 +20,6 @@ extern crate lazy_static;
#[cfg(test)]
#[macro_use]
extern crate quickcheck;
#[cfg(test)]
extern crate wabt;
// Just so we can implement `Signature` for `cranelift_codegen::ir::Signature`
extern crate cranelift_codegen;
extern crate multi_mut;

View File

@@ -1,8 +1,7 @@
use super::{module::ExecutionError, translate, ExecutableModule};
use wabt;
fn translate_wat(wat: &str) -> ExecutableModule {
let wasm = wabt::wat2wasm(wat).unwrap();
let wasm = wat::parse_str(wat).unwrap();
let compiled = translate(&wasm).unwrap();
compiled
}