blob: cc48ddd70f19fe281fe33c43fc1f7ddb0b6373b0 [file] [log] [blame]
David Tolnay983cd142019-05-08 15:05:54 -07001// 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.
Nika Layzell27726662017-10-24 23:16:35 -040011
David Tolnay6af48992018-08-01 11:16:28 -070012#![recursion_limit = "128"]
David Tolnayc1f55792018-11-21 01:39:42 -080013#![allow(clippy::needless_pass_by_value)]
David Tolnayea9ae892017-12-26 01:44:32 -050014
David Tolnaycec98a72019-05-08 15:23:19 -070015mod file;
David Tolnayf1e57f02019-05-08 15:30:39 -070016mod fold;
David Tolnay1db3d8e2019-05-08 16:10:25 -070017mod full;
David Tolnay1e99fa32019-05-08 16:18:36 -070018mod gen;
Carl Lerche9a7d5882019-02-15 12:27:04 -080019mod json;
David Tolnaye627fa82019-05-08 16:58:01 -070020mod operand;
Carl Lerche058ff472019-02-13 16:23:52 -080021mod parse;
David Tolnay10227122019-02-15 20:53:45 -080022mod version;
David Tolnay490b91b2019-05-08 15:46:09 -070023mod visit;
24mod visit_mut;
David Tolnay8c81f622018-07-31 23:34:35 -070025
Nika Layzell27726662017-10-24 23:16:35 -040026fn main() {
David Tolnay10227122019-02-15 20:53:45 -080027 let defs = parse::parse();
David Tolnay10227122019-02-15 20:53:45 -080028 json::generate(&defs);
David Tolnayf1e57f02019-05-08 15:30:39 -070029 fold::generate(&defs);
David Tolnay490b91b2019-05-08 15:46:09 -070030 visit::generate(&defs);
31 visit_mut::generate(&defs);
Nika Layzell27726662017-10-24 23:16:35 -040032}