Backed out 5 changesets (bug 1890092, bug 1888683) for causing build bustages & crash...
[gecko.git] / third_party / rust / weedle2 / README.md
blob889dc0da193cf7a94a34aec2fbf82bd6e81c1984
1 <div align="center">
3   <h1>Weedle 2 - Electric Boogaloo</h1>
5   <strong>A Web IDL parser</strong>
7   <p>
8     <a href="https://crates.io/crates/weedle2"><img src="https://img.shields.io/crates/v/weedle2.svg?style=flat-square" alt="Crates.io version" /></a>
9     <a href="https://docs.rs/weedle2"><img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" alt="Documentation" /></a>
10     <a href="LICENSE"><img src="https://img.shields.io/crates/l/weedle2/2.0.0?style=flat-square" alt="MIT License" /></a>
11   </p>
13   <sub>
14   Built with ðŸ¦€ðŸ•¸ by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a>.
15   <br>
16   Forked to extend the functionality beyond WebIDL needs.
17   </sub>
18 </div>
20 ## About
22 Parses valid WebIDL definitions & produces a data structure starting from
23 [`Definitions`](https://docs.rs/weedle/latest/weedle/type.Definitions.html).
25 ## Usage
27 ### `Cargo.toml`
29 ```toml
30 [dependencies]
31 weedle2 = "4.0.0"
32 ```
34 ### `src/main.rs`
36 ```rust
37 fn main() {
38     let parsed = weedle::parse("
39         interface Window {
40             readonly attribute Storage sessionStorage;
41         };
42     ").unwrap();
44     println!("{:?}", parsed);
46 ```