David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 1 | Nom parser for Rust items |
| 2 | ========================= |
| 3 | |
| 4 | Parse 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 Tolnay | 3192a89 | 2016-09-04 11:17:06 -0700 | [diff] [blame^] | 9 | item = "0.2" |
David Tolnay | 35161ff | 2016-09-03 11:33:15 -0700 | [diff] [blame] | 10 | ``` |
| 11 | |
| 12 | ```rust |
| 13 | extern crate item; |
| 14 | |
| 15 | let raw = " |
| 16 | #[derive(Debug, Clone)] |
| 17 | pub struct Item { |
| 18 | pub ident: Ident, |
| 19 | pub attrs: Vec<Attribute>, |
| 20 | } |
| 21 | "; |
| 22 | |
| 23 | let ast = item::parse(raw).unwrap(); |
| 24 | ``` |
| 25 | |
| 26 | ## License |
| 27 | |
| 28 | Licensed 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 | |
| 33 | at your option. |
| 34 | |
| 35 | ### Contribution |
| 36 | |
| 37 | Unless you explicitly state otherwise, any contribution intentionally submitted |
| 38 | for inclusion in this crate by you, as defined in the Apache-2.0 license, shall |
| 39 | be dual licensed as above, without any additional terms or conditions. |