gecko-dev/third_party/rust/wast
Ryan Hunt 54aee7836c Bug 1645160 - Update wat to 1.0.20. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D80190
2020-06-22 04:30:09 +00:00
..
src Bug 1645160 - Update wat to 1.0.20. r=lth 2020-06-22 04:30:09 +00:00
tests Bug 1642589 - Pull in new wat crate. r=rhunt 2020-06-08 08:01:13 +00:00
.cargo-checksum.json Bug 1645160 - Update wat to 1.0.20. r=lth 2020-06-22 04:30:09 +00:00
Cargo.toml Bug 1645160 - Update wat to 1.0.20. r=lth 2020-06-22 04:30:09 +00:00
LICENSE-APACHE Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
LICENSE-MIT Bug 1612534 - Include vendored files. r=lth 2020-03-23 16:16:46 +00:00
README.md Bug 1642589 - Pull in new wat crate. r=rhunt 2020-06-08 08:01:13 +00:00

README.md

wast

A Bytecode Alliance project

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

Crates.io version Download docs.rs docs

Usage

Add this to your Cargo.toml:

[dependencies]
wast = "17.0"

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 do 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.

[dependencies]
wast = { version = "17.0", default-features = false }

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.