123 releases (major breaking)

new 220.0.0 Nov 12, 2024
219.0.1 Oct 10, 2024
218.0.0 Sep 30, 2024
217.0.0 Sep 10, 2024
1.0.2 Oct 17, 2019

#41 in Parser implementations

Download history 164724/week @ 2024-07-28 164082/week @ 2024-08-04 174609/week @ 2024-08-11 186783/week @ 2024-08-18 158734/week @ 2024-08-25 169607/week @ 2024-09-01 164220/week @ 2024-09-08 153066/week @ 2024-09-15 155926/week @ 2024-09-22 156955/week @ 2024-09-29 183583/week @ 2024-10-06 151608/week @ 2024-10-13 163985/week @ 2024-10-20 159943/week @ 2024-10-27 181516/week @ 2024-11-03 147529/week @ 2024-11-10

662,404 downloads per month
Used in 587 crates (50 directly)

Apache-2.0…

1MB
26K SLoC

wast

A Bytecode Alliance project

A Rust parser for the WebAssembly Text Format (WAT).

Crates.io version Download docs.rs docs

Usage

Add wast to your Cargo.toml

$ cargo add wast

The intent of this crate is to provide utilities, combinators, and built-in types to parse anything that looks like a WebAssembly s-expression.

  • Need to parse a *.wat file?
  • Need to parse a *.wast file?
  • Need to run test suite assertions from the official wasm test suite?
  • Want to write an extension to the WebAssembly text format?

If you'd like to do any of the above this crate might be right for you! You may also want to check out the wat crate which provides a much more stable interface if all you'd like to do is convert *.wat to *.wasm.

Cargo features

By default this crate enables and exports support necessary to parse *.wat and *.wast files, or in other words entire wasm modules. If you're using this crate, however, to parse simply an s-expression wasm-related format (like *.witx or *.wit perhaps) then you can disable the default set of features to only include a lexer, the parsing framework, and a few basic token-related parsers.

$ cargo add wast --no-default-features

License

This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.8–2.8MB
~44K SLoC