blob: d2ea2675e7ce2f1b908e676bfe3e70ca1115e9c6 [file] [log] [blame] [view]
David Tolnay35161ff2016-09-03 11:33:15 -07001Nom parser for Rust items
2=========================
3
4Parse Rust structs and enums without a Syntex dependency, intended for use with
5[Macros 1.1](https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md).
6
7```toml
8[dependencies]
David Tolnay3192a892016-09-04 11:17:06 -07009item = "0.2"
David Tolnay35161ff2016-09-03 11:33:15 -070010```
11
12```rust
13extern crate item;
14
15let raw = "
16 #[derive(Debug, Clone)]
17 pub struct Item {
18 pub ident: Ident,
19 pub attrs: Vec<Attribute>,
20 }
21";
22
23let ast = item::parse(raw).unwrap();
24```
25
26## License
27
28Licensed under either of
29
30 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
31 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
32
33at your option.
34
35### Contribution
36
37Unless you explicitly state otherwise, any contribution intentionally submitted
38for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
39be dual licensed as above, without any additional terms or conditions.