A Rust-native WebAssembly syntax model useful for generating, reading, and emitting WebAssembly code.
WASM-AST is designed with minimal validation. The goal is to closely model the WASM syntax specification in order to allow valid and invalid abstract syntax trees.
To use wasm-ast
, first add this to your Cargo.toml
:
toml
[dependencies]
wasm-ast = "0.0.1"
Then, add this to your crate:
```rust use wasm_ast::model::Module;
fn main() { // ... } ```
Create an empty WASM module:
```rust use wasm_ast::model::Module;
fn main() { let builder = Module.builder(); let module = builder.build(); } ```
Licensed under Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.