diff --git a/tasks/ast_tools/src/parse/mod.rs b/tasks/ast_tools/src/parse/mod.rs index b275fef1d644d..15e207d6cdfe3 100644 --- a/tasks/ast_tools/src/parse/mod.rs +++ b/tasks/ast_tools/src/parse/mod.rs @@ -47,15 +47,13 @@ //! [`Derive`]: crate::Derive //! [`Generator`]: crate::Generator -use indexmap::{IndexMap, IndexSet}; use oxc_index::IndexVec; -use rustc_hash::FxBuildHasher; use syn::Ident; use crate::{ Codegen, log, log_success, - schema::Derives, - schema::{File, FileId, Schema}, + schema::{Derives, File, FileId, Schema}, + utils::FxIndexMap, }; pub mod attr; @@ -67,9 +65,6 @@ use load::load_file; use parse::parse; use skeleton::Skeleton; -type FxIndexMap = IndexMap; -type FxIndexSet = IndexSet; - /// Analyse the files with provided paths, and generate a [`Schema`]. pub fn parse_files(file_paths: &[&str], codegen: &Codegen) -> Schema { // Load files and populate `skeletons` and `meta_skeletons` + mapping from type name to `TypeId`. diff --git a/tasks/ast_tools/src/parse/parse.rs b/tasks/ast_tools/src/parse/parse.rs index 0ae9d1fc66a36..f2890d0bf3db9 100644 --- a/tasks/ast_tools/src/parse/parse.rs +++ b/tasks/ast_tools/src/parse/parse.rs @@ -14,10 +14,11 @@ use crate::{ BoxDef, CellDef, Def, EnumDef, FieldDef, File, FileId, MetaId, MetaType, OptionDef, PrimitiveDef, Schema, StructDef, TypeDef, TypeId, VariantDef, VecDef, Visibility, }, + utils::{FxIndexMap, FxIndexSet}, }; use super::{ - Derives, FxIndexMap, FxIndexSet, + Derives, attr::{AttrLocation, AttrPart, AttrPartListElement, AttrPositions, AttrProcessor}, ident_name, skeleton::{EnumSkeleton, Skeleton, StructSkeleton}, diff --git a/tasks/ast_tools/src/utils.rs b/tasks/ast_tools/src/utils.rs index b0512e3e9d3e1..eecef041284f9 100644 --- a/tasks/ast_tools/src/utils.rs +++ b/tasks/ast_tools/src/utils.rs @@ -1,8 +1,13 @@ +use indexmap::{IndexMap, IndexSet}; use phf::{Set as PhfSet, phf_set}; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote}; +use rustc_hash::FxBuildHasher; use syn::{Ident, LitInt}; +pub type FxIndexMap = IndexMap; +pub type FxIndexSet = IndexSet; + /// Reserved word in Rust. /// From . static RESERVED_NAMES: PhfSet<&'static str> = phf_set! {