blob: a83cbfc6db3dbf2b6d45a3f4b36f437c292c18d4 [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;
Carl Lerche058ff472019-02-13 16:23:52 -080017mod gen;
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 Tolnay8c81f622018-07-31 23:34:35 -070021
Nika Layzell27726662017-10-24 23:16:35 -040022fn main() {
David Tolnay10227122019-02-15 20:53:45 -080023 let defs = parse::parse();
David Tolnay10227122019-02-15 20:53:45 -080024 json::generate(&defs);
David Tolnay983cd142019-05-08 15:05:54 -070025 gen::generate(&defs);
David Tolnayf1e57f02019-05-08 15:30:39 -070026 fold::generate(&defs);
Nika Layzell27726662017-10-24 23:16:35 -040027}