blob: d29a28cc87346e756e148e6017abeace5daac126 [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
Carl Lerche058ff472019-02-13 16:23:52 -080015mod gen;
Carl Lerche9a7d5882019-02-15 12:27:04 -080016mod json;
Carl Lerche058ff472019-02-13 16:23:52 -080017mod parse;
David Tolnay10227122019-02-15 20:53:45 -080018mod version;
David Tolnay8c81f622018-07-31 23:34:35 -070019
Nika Layzell27726662017-10-24 23:16:35 -040020fn main() {
David Tolnay10227122019-02-15 20:53:45 -080021 let defs = parse::parse();
David Tolnay10227122019-02-15 20:53:45 -080022 json::generate(&defs);
David Tolnay983cd142019-05-08 15:05:54 -070023 gen::generate(&defs);
Nika Layzell27726662017-10-24 23:16:35 -040024}