blob: d80782b6749b79bddfe91bc70241f83ddfaa5aa3 [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;
Carl Lerche9a7d5882019-02-15 12:27:04 -080018mod json;
Carl Lerche058ff472019-02-13 16:23:52 -080019mod parse;
David Tolnay10227122019-02-15 20:53:45 -080020mod version;
David Tolnay490b91b2019-05-08 15:46:09 -070021mod visit;
22mod visit_mut;
David Tolnay8c81f622018-07-31 23:34:35 -070023
Nika Layzell27726662017-10-24 23:16:35 -040024fn main() {
David Tolnay10227122019-02-15 20:53:45 -080025 let defs = parse::parse();
David Tolnay10227122019-02-15 20:53:45 -080026 json::generate(&defs);
David Tolnayf1e57f02019-05-08 15:30:39 -070027 fold::generate(&defs);
David Tolnay490b91b2019-05-08 15:46:09 -070028 visit::generate(&defs);
29 visit_mut::generate(&defs);
Nika Layzell27726662017-10-24 23:16:35 -040030}