summaryrefslogtreecommitdiff
path: root/crates/parser/README.md
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-10-31 11:10:49 -0400
committerMica White <botahamec@outlook.com>2026-10-31 11:10:49 -0400
commit264ea48cc8c6dd9c3c9e0fe1a559252863fc9962 (patch)
tree84a4a58de14442f4fcfa06bd0d82480508f82759 /crates/parser/README.md
parent7877eca4e8be283e7c51168ee3a3b05d9000f39c (diff)
parentb45a98a85c776d956a797773acd2f198c06b40ed (diff)
Merge branch 'main' into bota-tortuise
Diffstat (limited to 'crates/parser/README.md')
-rw-r--r--crates/parser/README.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/parser/README.md b/crates/parser/README.md
index 91145f1..cf1a6c4 100644
--- a/crates/parser/README.md
+++ b/crates/parser/README.md
@@ -6,7 +6,8 @@ This crate provides the parser and lowering pipeline that converts WebAssembly b
- `std`: Enables the use of `std` and `std::io` for parsing from files and streams.
- `log`: Enables logging of the parsing process using the `log` crate.
-- `parallel`: Enables multithreaded parsing and validation when `std` is available.
+- `parallel`: Enables multithreaded function parsing. Requires `std`.
+- `validate`: Enables `wasmparser` validation. Enabled by default and configurable through `ParserOptions`.
## Usage
@@ -15,10 +16,10 @@ use tinywasm_parser::{Parser, ParserOptions};
let bytes = include_bytes!("./file.wasm");
-let parser = Parser::new();
+let parser = Parser::default();
let module = parser.parse_module_bytes(bytes)?;
-let parser = Parser::with_options(ParserOptions::default().with_rewrite_optimization(false));
+let parser = Parser::new(ParserOptions::default().with_rewrite_optimization(false));
let module = parser.parse_module_bytes(bytes)?;
let module = parser.parse_module_file("path/to/file.wasm")?;
@@ -26,4 +27,4 @@ let mut stream = std::fs::File::open("path/to/file.wasm")?;
let module = parser.parse_module_stream(&mut stream)?;
```
-If you just want the default configuration, the top-level `parse_bytes`, `parse_file`, and `parse_stream` helpers are thin wrappers around `Parser::new()`.
+If you just want the default configuration, the top-level `parse_bytes`, `parse_file`, and `parse_stream` helpers are thin wrappers around `Parser::default()`.