diff --git a/Cargo.lock b/Cargo.lock index b2bc557..1f540fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,12 +11,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - [[package]] name = "atty" version = "0.2.14" @@ -116,12 +110,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "fastrand" version = "1.8.0" @@ -221,7 +209,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.2", + "indexmap", "slab", "tokio", "tokio-util", @@ -234,12 +222,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - [[package]] name = "hermit-abi" version = "0.1.19" @@ -337,17 +319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", + "hashbrown", ] [[package]] @@ -646,12 +618,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" - [[package]] name = "serde" version = "1.0.149" @@ -969,38 +935,6 @@ dependencies = [ "leb128", ] -[[package]] -name = "wasmparser" -version = "0.112.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" -dependencies = [ - "indexmap 2.0.0", - "semver", -] - -[[package]] -name = "wasmprinter" -version = "0.2.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ddf5892036cd4b780d505eff1194a0cbc10ed896097656fdcea3744b5e7c2f" -dependencies = [ - "anyhow", - "wasmparser", -] - -[[package]] -name = "wast" -version = "64.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc" -dependencies = [ - "leb128", - "memchr", - "unicode-width", - "wasm-encoder", -] - [[package]] name = "web-sys" version = "0.3.60" @@ -1041,9 +975,6 @@ version = "0.1.0" dependencies = [ "byteorder", "wasm-encoder", - "wasmparser", - "wasmprinter", - "wast", "whistle_ast", "whistle_common", "whistle_parser", diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index cbe4c6a..f857e57 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -9,7 +9,4 @@ whistle_common = { path = "../common/" } whistle_parser = { path = "../parser/" } whistle_ast = { path = "../ast/" } wasm-encoder = "0.32.0" -wast = "64.0.0" -wasmprinter = "0.2.64" -wasmparser = "0.112.0" byteorder = "1.4.3" diff --git a/compiler/src/compilers/tip.rs b/compiler/src/compilers/tip.rs index b2f09f3..2ee3b44 100644 --- a/compiler/src/compilers/tip.rs +++ b/compiler/src/compilers/tip.rs @@ -20,12 +20,3 @@ pub fn compile_tip_wasm_bytes( function.raw(data); } -pub fn compile_tip_wast(compiler: &mut Compiler, tip: Tip, _span: whistle_common::Span) { - let lexer = wast::lexer::Lexer::new(tip.value.as_str()); - let buf = wast::parser::ParseBuffer::new_with_lexer(lexer).unwrap(); - let ast = wast::parser::parse::(&buf) - .unwrap() - .encode() - .unwrap(); - compiler.module.code.raw(&ast); -} diff --git a/test.wasm b/test.wasm new file mode 100644 index 0000000..9e00bf6 Binary files /dev/null and b/test.wasm differ