1 // This crate crawls the Syn source directory to find all structs and enums that 2 // form the Syn syntax tree. 3 // 4 // A machine-readable representation of the syntax tree is saved to syn.json in 5 // the repo root for other code generation tools to consume. The syn-codegen 6 // crate (https://docs.rs/syn-codegen/) provides the data structures for parsing 7 // and making use of syn.json from Rust code. 8 // 9 // Finally this crate generates the Visit, VisitMut, and Fold traits in Syn 10 // programmatically from the syntax tree description. 11 12 #![allow(clippy::needless_pass_by_value)] 13 14 mod cfg; 15 mod clone; 16 mod debug; 17 mod eq; 18 mod file; 19 mod fold; 20 mod full; 21 mod gen; 22 mod hash; 23 mod json; 24 mod lookup; 25 mod operand; 26 mod parse; 27 mod snapshot; 28 mod version; 29 mod visit; 30 mod visit_mut; 31 main() -> anyhow::Result<()>32fn main() -> anyhow::Result<()> { 33 color_backtrace::install(); 34 let defs = parse::parse()?; 35 clone::generate(&defs)?; 36 debug::generate(&defs)?; 37 eq::generate(&defs)?; 38 hash::generate(&defs)?; 39 json::generate(&defs)?; 40 fold::generate(&defs)?; 41 visit::generate(&defs)?; 42 visit_mut::generate(&defs)?; 43 snapshot::generate(&defs)?; 44 Ok(()) 45 } 46