diff --git a/.cargo/config.toml b/.cargo/config.toml index 29544d3d4a25..9d71e7f2c6b9 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,6 @@ [alias] -xtask = "run --package xtask --" +codegen = "run --package generate-code --" +xtask = "run --package xtask --" [build] diff --git a/Cargo.lock b/Cargo.lock index dda7b04ba9cb..92a9e14405dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ "clap_lex 0.2.4", "indexmap 1.9.3", "once_cell", - "strsim", + "strsim 0.10.0", "termcolor", "terminal_size", "textwrap", @@ -570,24 +570,24 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.18" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", - "clap_derive 4.4.7", + "clap_derive 4.5.8", ] [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", - "clap_lex 0.6.0", - "strsim", + "clap_lex 0.7.1", + "strsim 0.11.1", ] [[package]] @@ -605,11 +605,11 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.55", @@ -626,9 +626,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "codspeed" @@ -892,7 +892,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.4.18", + "clap 4.5.9", "criterion-plot", "is-terminal", "itertools 0.10.5", @@ -1024,7 +1024,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] @@ -1495,6 +1495,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generate-code" +version = "0.1.0" +dependencies = [ + "Inflector", + "anyhow", + "clap 4.5.9", + "proc-macro2", + "quote", + "syn 2.0.55", + "walkdir", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1651,6 +1664,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -3621,6 +3640,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "swc" version = "0.281.0" @@ -6906,7 +6931,7 @@ dependencies = [ "anyhow", "cargo_metadata", "chrono", - "clap 4.4.18", + "clap 4.5.9", "semver 1.0.21", "serde", "serde_derive", diff --git a/Cargo.toml b/Cargo.toml index e3f57b61e957..ce8105de1f12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ members = [ "crates/swc_transform_common", "crates/swc_typescript", "crates/swc_fast_ts_strip", + "tools/generate-code", ] resolver = "2" diff --git a/crates/swc_ecma_visit/src/generated.rs b/crates/swc_ecma_visit/src/generated.rs new file mode 100644 index 000000000000..819e28a3cb4e --- /dev/null +++ b/crates/swc_ecma_visit/src/generated.rs @@ -0,0 +1,52561 @@ +#![doc = r" This file is generated by `tools/generate-code`. DO NOT MODIFY."] +use swc_ecma_ast::*; +#[doc = r" A visitor trait for traversing the AST."] +pub trait Visit { + #[doc = "Visit a node of type `Accessibility`.\n\nBy default, this method calls \ + [`Accessibility::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_accessibility(&mut self, node: &Accessibility) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Align64`.\n\nBy default, this method calls \ + [`Align64::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_align_64(&mut self, node: &Align64) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ArrayLit`.\n\nBy default, this method calls \ + [`ArrayLit::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_array_lit(&mut self, node: &ArrayLit) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ArrayPat`.\n\nBy default, this method calls \ + [`ArrayPat::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_array_pat(&mut self, node: &ArrayPat) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ArrowExpr`.\n\nBy default, this method calls \ + [`ArrowExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_arrow_expr(&mut self, node: &ArrowExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignExpr`.\n\nBy default, this method calls \ + [`AssignExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_expr(&mut self, node: &AssignExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignOp`.\n\nBy default, this method calls \ + [`AssignOp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_op(&mut self, node: &AssignOp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignPat`.\n\nBy default, this method calls \ + [`AssignPat::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_pat(&mut self, node: &AssignPat) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignPatProp`.\n\nBy default, this method calls \ + [`AssignPatProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_pat_prop(&mut self, node: &AssignPatProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignProp`.\n\nBy default, this method calls \ + [`AssignProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_prop(&mut self, node: &AssignProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignTarget`.\n\nBy default, this method calls \ + [`AssignTarget::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_target(&mut self, node: &AssignTarget) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AssignTargetPat`.\n\nBy default, this method calls \ + [`AssignTargetPat::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_assign_target_pat(&mut self, node: &AssignTargetPat) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AutoAccessor`.\n\nBy default, this method calls \ + [`AutoAccessor::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_auto_accessor(&mut self, node: &AutoAccessor) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `AwaitExpr`.\n\nBy default, this method calls \ + [`AwaitExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_await_expr(&mut self, node: &AwaitExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BigInt`.\n\nBy default, this method calls \ + [`BigInt::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_big_int(&mut self, node: &BigInt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BinExpr`.\n\nBy default, this method calls \ + [`BinExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_bin_expr(&mut self, node: &BinExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BinaryOp`.\n\nBy default, this method calls \ + [`BinaryOp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_binary_op(&mut self, node: &BinaryOp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BindingIdent`.\n\nBy default, this method calls \ + [`BindingIdent::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_binding_ident(&mut self, node: &BindingIdent) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BlockStmt`.\n\nBy default, this method calls \ + [`BlockStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_block_stmt(&mut self, node: &BlockStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BlockStmtOrExpr`.\n\nBy default, this method calls \ + [`BlockStmtOrExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_block_stmt_or_expr(&mut self, node: &BlockStmtOrExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Bool`.\n\nBy default, this method calls \ + [`Bool::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_bool(&mut self, node: &Bool) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `BreakStmt`.\n\nBy default, this method calls \ + [`BreakStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_break_stmt(&mut self, node: &BreakStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CallExpr`.\n\nBy default, this method calls \ + [`CallExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_call_expr(&mut self, node: &CallExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Callee`.\n\nBy default, this method calls \ + [`Callee::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_callee(&mut self, node: &Callee) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CatchClause`.\n\nBy default, this method calls \ + [`CatchClause::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_catch_clause(&mut self, node: &CatchClause) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Class`.\n\nBy default, this method calls \ + [`Class::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_class(&mut self, node: &Class) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ClassDecl`.\n\nBy default, this method calls \ + [`ClassDecl::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_class_decl(&mut self, node: &ClassDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ClassExpr`.\n\nBy default, this method calls \ + [`ClassExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_class_expr(&mut self, node: &ClassExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ClassMember`.\n\nBy default, this method calls \ + [`ClassMember::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_class_member(&mut self, node: &ClassMember) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ClassProp`.\n\nBy default, this method calls \ + [`ClassProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_class_prop(&mut self, node: &ClassProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ComputedPropName`.\n\nBy default, this method calls \ + [`ComputedPropName::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_computed_prop_name(&mut self, node: &ComputedPropName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `CondExpr`.\n\nBy default, this method calls \ + [`CondExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_cond_expr(&mut self, node: &CondExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Constructor`.\n\nBy default, this method calls \ + [`Constructor::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_constructor(&mut self, node: &Constructor) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ContinueStmt`.\n\nBy default, this method calls \ + [`ContinueStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_continue_stmt(&mut self, node: &ContinueStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `DebuggerStmt`.\n\nBy default, this method calls \ + [`DebuggerStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_debugger_stmt(&mut self, node: &DebuggerStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Decl`.\n\nBy default, this method calls \ + [`Decl::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_decl(&mut self, node: &Decl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Decorator`.\n\nBy default, this method calls \ + [`Decorator::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_decorator(&mut self, node: &Decorator) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `DefaultDecl`.\n\nBy default, this method calls \ + [`DefaultDecl::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_default_decl(&mut self, node: &DefaultDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `DoWhileStmt`.\n\nBy default, this method calls \ + [`DoWhileStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_do_while_stmt(&mut self, node: &DoWhileStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `EmptyStmt`.\n\nBy default, this method calls \ + [`EmptyStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_empty_stmt(&mut self, node: &EmptyStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `EncodeBigInt`.\n\nBy default, this method calls \ + [`EncodeBigInt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_encode_big_int(&mut self, node: &EncodeBigInt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `EsVersion`.\n\nBy default, this method calls \ + [`EsVersion::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_es_version(&mut self, node: &EsVersion) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportAll`.\n\nBy default, this method calls \ + [`ExportAll::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_export_all(&mut self, node: &ExportAll) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportDecl`.\n\nBy default, this method calls \ + [`ExportDecl::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_export_decl(&mut self, node: &ExportDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportDefaultDecl`.\n\nBy default, this method calls \ + [`ExportDefaultDecl::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_export_default_decl(&mut self, node: &ExportDefaultDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportDefaultExpr`.\n\nBy default, this method calls \ + [`ExportDefaultExpr::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_export_default_expr(&mut self, node: &ExportDefaultExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportDefaultSpecifier`.\n\nBy default, this method calls \ + [`ExportDefaultSpecifier::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + fn visit_export_default_specifier(&mut self, node: &ExportDefaultSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportNamedSpecifier`.\n\nBy default, this method calls \ + [`ExportNamedSpecifier::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + fn visit_export_named_specifier(&mut self, node: &ExportNamedSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportNamespaceSpecifier`.\n\nBy default, this method calls \ + [`ExportNamespaceSpecifier::visit_children_with`]. If you want to recurse, you need \ + to call it manually."] + fn visit_export_namespace_specifier(&mut self, node: &ExportNamespaceSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExportSpecifier`.\n\nBy default, this method calls \ + [`ExportSpecifier::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_export_specifier(&mut self, node: &ExportSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Expr`.\n\nBy default, this method calls \ + [`Expr::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_expr(&mut self, node: &Expr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExprOrSpread`.\n\nBy default, this method calls \ + [`ExprOrSpread::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_expr_or_spread(&mut self, node: &ExprOrSpread) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ExprStmt`.\n\nBy default, this method calls \ + [`ExprStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_expr_stmt(&mut self, node: &ExprStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `FnDecl`.\n\nBy default, this method calls \ + [`FnDecl::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_fn_decl(&mut self, node: &FnDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `FnExpr`.\n\nBy default, this method calls \ + [`FnExpr::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_fn_expr(&mut self, node: &FnExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ForHead`.\n\nBy default, this method calls \ + [`ForHead::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_for_head(&mut self, node: &ForHead) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ForInStmt`.\n\nBy default, this method calls \ + [`ForInStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_for_in_stmt(&mut self, node: &ForInStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ForOfStmt`.\n\nBy default, this method calls \ + [`ForOfStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_for_of_stmt(&mut self, node: &ForOfStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ForStmt`.\n\nBy default, this method calls \ + [`ForStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_for_stmt(&mut self, node: &ForStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Function`.\n\nBy default, this method calls \ + [`Function::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_function(&mut self, node: &Function) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `GetterProp`.\n\nBy default, this method calls \ + [`GetterProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_getter_prop(&mut self, node: &GetterProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Ident`.\n\nBy default, this method calls \ + [`Ident::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_ident(&mut self, node: &Ident) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `IdentName`.\n\nBy default, this method calls \ + [`IdentName::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_ident_name(&mut self, node: &IdentName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `IfStmt`.\n\nBy default, this method calls \ + [`IfStmt::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_if_stmt(&mut self, node: &IfStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Import`.\n\nBy default, this method calls \ + [`Import::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_import(&mut self, node: &Import) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportDecl`.\n\nBy default, this method calls \ + [`ImportDecl::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_import_decl(&mut self, node: &ImportDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportDefaultSpecifier`.\n\nBy default, this method calls \ + [`ImportDefaultSpecifier::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + fn visit_import_default_specifier(&mut self, node: &ImportDefaultSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportNamedSpecifier`.\n\nBy default, this method calls \ + [`ImportNamedSpecifier::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + fn visit_import_named_specifier(&mut self, node: &ImportNamedSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportPhase`.\n\nBy default, this method calls \ + [`ImportPhase::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_import_phase(&mut self, node: &ImportPhase) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportSpecifier`.\n\nBy default, this method calls \ + [`ImportSpecifier::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_import_specifier(&mut self, node: &ImportSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportStarAsSpecifier`.\n\nBy default, this method calls \ + [`ImportStarAsSpecifier::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + fn visit_import_star_as_specifier(&mut self, node: &ImportStarAsSpecifier) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportWith`.\n\nBy default, this method calls \ + [`ImportWith::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_import_with(&mut self, node: &ImportWith) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ImportWithItem`.\n\nBy default, this method calls \ + [`ImportWithItem::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_import_with_item(&mut self, node: &ImportWithItem) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Invalid`.\n\nBy default, this method calls \ + [`Invalid::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_invalid(&mut self, node: &Invalid) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXAttr`.\n\nBy default, this method calls \ + [`JSXAttr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_attr(&mut self, node: &JSXAttr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXAttrName`.\n\nBy default, this method calls \ + [`JSXAttrName::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_attr_name(&mut self, node: &JSXAttrName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXAttrOrSpread`.\n\nBy default, this method calls \ + [`JSXAttrOrSpread::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_attr_or_spread(&mut self, node: &JSXAttrOrSpread) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXAttrValue`.\n\nBy default, this method calls \ + [`JSXAttrValue::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_attr_value(&mut self, node: &JSXAttrValue) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXClosingElement`.\n\nBy default, this method calls \ + [`JSXClosingElement::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_jsx_closing_element(&mut self, node: &JSXClosingElement) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXClosingFragment`.\n\nBy default, this method calls \ + [`JSXClosingFragment::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_jsx_closing_fragment(&mut self, node: &JSXClosingFragment) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXElement`.\n\nBy default, this method calls \ + [`JSXElement::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_element(&mut self, node: &JSXElement) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXElementChild`.\n\nBy default, this method calls \ + [`JSXElementChild::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_element_child(&mut self, node: &JSXElementChild) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXElementName`.\n\nBy default, this method calls \ + [`JSXElementName::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_element_name(&mut self, node: &JSXElementName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXEmptyExpr`.\n\nBy default, this method calls \ + [`JSXEmptyExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_empty_expr(&mut self, node: &JSXEmptyExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXExpr`.\n\nBy default, this method calls \ + [`JSXExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_expr(&mut self, node: &JSXExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXExprContainer`.\n\nBy default, this method calls \ + [`JSXExprContainer::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_jsx_expr_container(&mut self, node: &JSXExprContainer) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXFragment`.\n\nBy default, this method calls \ + [`JSXFragment::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_fragment(&mut self, node: &JSXFragment) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXMemberExpr`.\n\nBy default, this method calls \ + [`JSXMemberExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_member_expr(&mut self, node: &JSXMemberExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXNamespacedName`.\n\nBy default, this method calls \ + [`JSXNamespacedName::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_jsx_namespaced_name(&mut self, node: &JSXNamespacedName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXObject`.\n\nBy default, this method calls \ + [`JSXObject::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_object(&mut self, node: &JSXObject) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXOpeningElement`.\n\nBy default, this method calls \ + [`JSXOpeningElement::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_jsx_opening_element(&mut self, node: &JSXOpeningElement) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXOpeningFragment`.\n\nBy default, this method calls \ + [`JSXOpeningFragment::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_jsx_opening_fragment(&mut self, node: &JSXOpeningFragment) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXSpreadChild`.\n\nBy default, this method calls \ + [`JSXSpreadChild::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_spread_child(&mut self, node: &JSXSpreadChild) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `JSXText`.\n\nBy default, this method calls \ + [`JSXText::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_jsx_text(&mut self, node: &JSXText) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Key`.\n\nBy default, this method calls \ + [`Key::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_key(&mut self, node: &Key) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `KeyValuePatProp`.\n\nBy default, this method calls \ + [`KeyValuePatProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_key_value_pat_prop(&mut self, node: &KeyValuePatProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `KeyValueProp`.\n\nBy default, this method calls \ + [`KeyValueProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_key_value_prop(&mut self, node: &KeyValueProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `LabeledStmt`.\n\nBy default, this method calls \ + [`LabeledStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_labeled_stmt(&mut self, node: &LabeledStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Lit`.\n\nBy default, this method calls \ + [`Lit::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_lit(&mut self, node: &Lit) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `MemberExpr`.\n\nBy default, this method calls \ + [`MemberExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_member_expr(&mut self, node: &MemberExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `MemberProp`.\n\nBy default, this method calls \ + [`MemberProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_member_prop(&mut self, node: &MemberProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `MetaPropExpr`.\n\nBy default, this method calls \ + [`MetaPropExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_meta_prop_expr(&mut self, node: &MetaPropExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `MetaPropKind`.\n\nBy default, this method calls \ + [`MetaPropKind::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_meta_prop_kind(&mut self, node: &MetaPropKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `MethodKind`.\n\nBy default, this method calls \ + [`MethodKind::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_method_kind(&mut self, node: &MethodKind) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `MethodProp`.\n\nBy default, this method calls \ + [`MethodProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_method_prop(&mut self, node: &MethodProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Module`.\n\nBy default, this method calls \ + [`Module::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_module(&mut self, node: &Module) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ModuleDecl`.\n\nBy default, this method calls \ + [`ModuleDecl::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_module_decl(&mut self, node: &ModuleDecl) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ModuleExportName`.\n\nBy default, this method calls \ + [`ModuleExportName::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_module_export_name(&mut self, node: &ModuleExportName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ModuleItem`.\n\nBy default, this method calls \ + [`ModuleItem::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_module_item(&mut self, node: &ModuleItem) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `NamedExport`.\n\nBy default, this method calls \ + [`NamedExport::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_named_export(&mut self, node: &NamedExport) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `NewExpr`.\n\nBy default, this method calls \ + [`NewExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_new_expr(&mut self, node: &NewExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Null`.\n\nBy default, this method calls \ + [`Null::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_null(&mut self, node: &Null) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Number`.\n\nBy default, this method calls \ + [`Number::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_number(&mut self, node: &Number) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ObjectLit`.\n\nBy default, this method calls \ + [`ObjectLit::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_object_lit(&mut self, node: &ObjectLit) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ObjectPat`.\n\nBy default, this method calls \ + [`ObjectPat::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_object_pat(&mut self, node: &ObjectPat) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ObjectPatProp`.\n\nBy default, this method calls \ + [`ObjectPatProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_object_pat_prop(&mut self, node: &ObjectPatProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `OptCall`.\n\nBy default, this method calls \ + [`OptCall::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_opt_call(&mut self, node: &OptCall) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `OptChainBase`.\n\nBy default, this method calls \ + [`OptChainBase::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_opt_chain_base(&mut self, node: &OptChainBase) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `OptChainExpr`.\n\nBy default, this method calls \ + [`OptChainExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_opt_chain_expr(&mut self, node: &OptChainExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Param`.\n\nBy default, this method calls \ + [`Param::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_param(&mut self, node: &Param) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ParamOrTsParamProp`.\n\nBy default, this method calls \ + [`ParamOrTsParamProp::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + fn visit_param_or_ts_param_prop(&mut self, node: &ParamOrTsParamProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ParenExpr`.\n\nBy default, this method calls \ + [`ParenExpr::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_paren_expr(&mut self, node: &ParenExpr) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Pat`.\n\nBy default, this method calls \ + [`Pat::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_pat(&mut self, node: &Pat) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `PrivateName`.\n\nBy default, this method calls \ + [`PrivateName::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_private_name(&mut self, node: &PrivateName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `PrivateProp`.\n\nBy default, this method calls \ + [`PrivateProp::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_private_prop(&mut self, node: &PrivateProp) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Program`.\n\nBy default, this method calls \ + [`Program::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_program(&mut self, node: &Program) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Prop`.\n\nBy default, this method calls \ + [`Prop::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_prop(&mut self, node: &Prop) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `PropName`.\n\nBy default, this method calls \ + [`PropName::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_prop_name(&mut self, node: &PropName) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `PropOrSpread`.\n\nBy default, this method calls \ + [`PropOrSpread::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_prop_or_spread(&mut self, node: &PropOrSpread) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Regex`.\n\nBy default, this method calls \ + [`Regex::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_regex(&mut self, node: &Regex) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ReservedUnused`.\n\nBy default, this method calls \ + [`ReservedUnused::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_reserved_unused(&mut self, node: &ReservedUnused) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `RestPat`.\n\nBy default, this method calls \ + [`RestPat::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_rest_pat(&mut self, node: &RestPat) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ReturnStmt`.\n\nBy default, this method calls \ + [`ReturnStmt::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + fn visit_return_stmt(&mut self, node: &ReturnStmt) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `Script`.\n\nBy default, this method calls \ + [`Script::visit_children_with`]. If you want to recurse, you need to call it manually."] + fn visit_script(&mut self, node: &Script) { +