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( 13 clippy::items_after_statements, 14 clippy::manual_let_else, 15 clippy::match_like_matches_macro, 16 clippy::similar_names, 17 clippy::too_many_lines, 18 clippy::uninlined_format_args 19 )] 20 21 mod cfg; 22 mod clone; 23 mod debug; 24 mod eq; 25 mod file; 26 mod fold; 27 mod full; 28 mod gen; 29 mod hash; 30 mod json; 31 mod lookup; 32 mod operand; 33 mod parse; 34 mod snapshot; 35 mod version; 36 mod visit; 37 mod visit_mut; 38 mod workspace_path; 39 main() -> anyhow::Result<()>40fn main() -> anyhow::Result<()> { 41 color_backtrace::install(); 42 let defs = parse::parse()?; 43 clone::generate(&defs)?; 44 debug::generate(&defs)?; 45 eq::generate(&defs)?; 46 hash::generate(&defs)?; 47 json::generate(&defs)?; 48 fold::generate(&defs)?; 49 visit::generate(&defs)?; 50 visit_mut::generate(&defs)?; 51 snapshot::generate(&defs)?; 52 Ok(()) 53 } 54