mirror of
https://github.com/openharmony/third_party_rust_syn.git
synced 2026-07-21 02:05:27 -04:00
38de391e34
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
54 lines
1.3 KiB
Rust
54 lines
1.3 KiB
Rust
// This crate crawls the Syn source directory to find all structs and enums that
|
|
// form the Syn syntax tree.
|
|
//
|
|
// A machine-readable representation of the syntax tree is saved to syn.json in
|
|
// the repo root for other code generation tools to consume. The syn-codegen
|
|
// crate (https://docs.rs/syn-codegen/) provides the data structures for parsing
|
|
// and making use of syn.json from Rust code.
|
|
//
|
|
// Finally this crate generates the Visit, VisitMut, and Fold traits in Syn
|
|
// programmatically from the syntax tree description.
|
|
|
|
#![allow(
|
|
clippy::items_after_statements,
|
|
clippy::manual_let_else,
|
|
clippy::match_like_matches_macro,
|
|
clippy::similar_names,
|
|
clippy::too_many_lines,
|
|
clippy::uninlined_format_args
|
|
)]
|
|
|
|
mod cfg;
|
|
mod clone;
|
|
mod debug;
|
|
mod eq;
|
|
mod file;
|
|
mod fold;
|
|
mod full;
|
|
mod gen;
|
|
mod hash;
|
|
mod json;
|
|
mod lookup;
|
|
mod operand;
|
|
mod parse;
|
|
mod snapshot;
|
|
mod version;
|
|
mod visit;
|
|
mod visit_mut;
|
|
mod workspace_path;
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
color_backtrace::install();
|
|
let defs = parse::parse()?;
|
|
clone::generate(&defs)?;
|
|
debug::generate(&defs)?;
|
|
eq::generate(&defs)?;
|
|
hash::generate(&defs)?;
|
|
json::generate(&defs)?;
|
|
fold::generate(&defs)?;
|
|
visit::generate(&defs)?;
|
|
visit_mut::generate(&defs)?;
|
|
snapshot::generate(&defs)?;
|
|
Ok(())
|
|
}
|