105 releases (major breaking)

new 206.0.0 Apr 25, 2024
205.0.0 Apr 18, 2024
204.0.0 Apr 16, 2024
203.0.0 Apr 12, 2024
1.0.2 Oct 17, 2019

#19 in Parser implementations

Download history 114660/week @ 2024-01-03 132912/week @ 2024-01-10 140958/week @ 2024-01-17 127011/week @ 2024-01-24 135341/week @ 2024-01-31 123277/week @ 2024-02-07 119223/week @ 2024-02-14 130328/week @ 2024-02-21 134873/week @ 2024-02-28 133677/week @ 2024-03-06 129942/week @ 2024-03-13 134138/week @ 2024-03-20 124243/week @ 2024-03-27 144432/week @ 2024-04-03 154643/week @ 2024-04-10 112849/week @ 2024-04-17

557,781 downloads per month
Used in 511 crates (46 directly)

Apache-2.0 WITH LLVM-exception

1MB
22K 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

~425–650KB