From d6ae7f67d8f59483abdda6babb114d96a331424c Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:05:39 -0500 Subject: [PATCH] Fix errors, run UPDATE=1 cargo test from tools/generate-code --- crates/swc_css_visit/src/generated.rs | 4 +- crates/swc_ecma_ast/src/class.rs | 3 +- crates/swc_ecma_ast/src/expr.rs | 1 + crates/swc_ecma_parser/src/lexer/state.rs | 153 +- crates/swc_ecma_visit/src/generated.rs | 2717 +++++++++++++++++++++ crates/swc_ecma_visit/src/lib.rs | 1389 ----------- crates/swc_typescript/src/fast_dts/mod.rs | 5 + 7 files changed, 2736 insertions(+), 1536 deletions(-) diff --git a/crates/swc_css_visit/src/generated.rs b/crates/swc_css_visit/src/generated.rs index 4e3932221a28..c1cd18b6160d 100644 --- a/crates/swc_css_visit/src/generated.rs +++ b/crates/swc_css_visit/src/generated.rs @@ -84590,7 +84590,9 @@ impl FoldWith for Token { let raw = { >::fold_with(raw, visitor) }; Token::BadUrl { raw } } - Token::Delim { value } => Token::Delim { value }, + Token::Delim { value } => { + Token::Delim { value } + } Token::Number { value, raw, diff --git a/crates/swc_ecma_ast/src/class.rs b/crates/swc_ecma_ast/src/class.rs index a00ca97e55a9..aa436b6869fb 100644 --- a/crates/swc_ecma_ast/src/class.rs +++ b/crates/swc_ecma_ast/src/class.rs @@ -12,8 +12,7 @@ use crate::{ TsTypeParamInstantiation, }, BigInt, ComputedPropName, ContentTagContent, ContentTagEnd, ContentTagStart, EmptyStmt, Id, - Ident, Number, - BigInt, ComputedPropName, EmptyStmt, Id, Ident, IdentName, Number, + Ident, IdentName, Number, }; #[ast_node] diff --git a/crates/swc_ecma_ast/src/expr.rs b/crates/swc_ecma_ast/src/expr.rs index e745ef6a281d..7ba60ee147b3 100644 --- a/crates/swc_ecma_ast/src/expr.rs +++ b/crates/swc_ecma_ast/src/expr.rs @@ -362,6 +362,7 @@ impl Expr { Expr::JSXEmpty(e) => e.span = span, Expr::JSXElement(e) => e.span = span, Expr::JSXFragment(e) => e.span = span, + Expr::ContentTagExpression(e) => e.span = span, Expr::PrivateName(e) => e.span = span, Expr::OptChain(e) => e.span = span, Expr::Lit(e) => e.set_span(span), diff --git a/crates/swc_ecma_parser/src/lexer/state.rs b/crates/swc_ecma_parser/src/lexer/state.rs index b83eb1effabc..1c260f6cd085 100644 --- a/crates/swc_ecma_parser/src/lexer/state.rs +++ b/crates/swc_ecma_parser/src/lexer/state.rs @@ -256,6 +256,14 @@ impl Lexer<'_> { } fn next_token(&mut self, start: &mut BytePos) -> Result, Error> { + if self.state.content_tag_template == ContentTagState::Reading { + return Ok(Some(self.read_content_tag_template()?)); + } + + if self.state.content_tag_template == ContentTagState::Ending { + return Ok(Some(self.end_content_tag_template()?)); + } + if let Some(start) = self.state.next_regexp { return Ok(Some(self.read_regexp(start)?)); } @@ -361,149 +369,6 @@ impl Iterator for Lexer<'_> { fn next(&mut self) -> Option { let mut start = self.cur_pos(); - let res = (|| -> Result, _> { - if self.state.content_tag_template == ContentTagState::Reading { - return Ok(Some(self.read_content_tag_template()?)); - } - - if self.state.content_tag_template == ContentTagState::Ending { - return Ok(Some(self.end_content_tag_template()?)); - } - - if let Some(start) = self.state.next_regexp { - return Ok(Some(self.read_regexp(start)?)); - } - - if self.state.is_first { - if let Some(shebang) = self.read_shebang()? { - return Ok(Some(Token::Shebang(shebang))); - } - } - - self.state.had_line_break = self.state.is_first; - self.state.is_first = false; - - // skip spaces before getting next character, if we are allowed to. - if self.state.can_skip_space() { - self.skip_space::()?; - start = self.input.cur_pos(); - }; - - match self.input.cur() { - Some(..) => {} - // End of input. - None => { - if let Some(comments) = self.comments.as_mut() { - let comments_buffer = self.comments_buffer.as_mut().unwrap(); - let last = self.state.prev_hi; - - // move the pending to the leading or trailing - for c in comments_buffer.take_pending_leading() { - // if the file had no tokens and no shebang, then treat any - // comments in the leading comments buffer as leading. - // Otherwise treat them as trailing. - if last == self.start_pos { - comments_buffer.push(BufferedComment { - kind: BufferedCommentKind::Leading, - pos: last, - comment: c, - }); - } else { - comments_buffer.push(BufferedComment { - kind: BufferedCommentKind::Trailing, - pos: last, - comment: c, - }); - } - } - - // now fill the user's passed in comments - for comment in comments_buffer.take_comments() { - match comment.kind { - BufferedCommentKind::Leading => { - comments.add_leading(comment.pos, comment.comment); - } - BufferedCommentKind::Trailing => { - comments.add_trailing(comment.pos, comment.comment); - } - } - } - } - - return Ok(None); - } - }; - - // println!( - // "\tContext: ({:?}) {:?}", - // self.input.cur().unwrap(), - // self.state.context.0 - // ); - - self.state.start = start; - - if self.syntax.jsx() && !self.ctx.in_property_name && !self.ctx.in_type { - //jsx - if self.state.context.current() == Some(TokenContext::JSXExpr) { - return self.read_jsx_token(); - } - - let c = self.cur(); - if let Some(c) = c { - if self.state.context.current() == Some(TokenContext::JSXOpeningTag) - || self.state.context.current() == Some(TokenContext::JSXClosingTag) - { - if c.is_ident_start() { - return self.read_jsx_word().map(Some); - } - - if c == '>' { - unsafe { - // Safety: cur() is Some('>') - self.input.bump(); - } - return Ok(Some(Token::JSXTagEnd)); - } - - if (c == '\'' || c == '"') - && self.state.context.current() == Some(TokenContext::JSXOpeningTag) - { - return self.read_jsx_str(c).map(Some); - } - } - - if c == '<' && self.state.is_expr_allowed && self.input.peek() != Some('!') { - let had_line_break_before_last = self.had_line_break_before_last(); - let cur_pos = self.input.cur_pos(); - - unsafe { - // Safety: cur() is Some('<') - self.input.bump(); - } - - if had_line_break_before_last && self.is_str("<<<<<< ") { - let span = Span::new(cur_pos, cur_pos + BytePos(7), Default::default()); - - self.emit_error_span(span, SyntaxError::TS1185); - self.skip_line_comment(6); - self.skip_space::()?; - return self.read_token(); - } - - return Ok(Some(Token::JSXTagStart)); - } - } - } - - if let Some(TokenContext::Tpl { - start: start_pos_of_tpl, - }) = self.state.context.current() - { - return self.read_tmpl_token(start_pos_of_tpl).map(Some); - } - - self.read_token() - })(); let res = self.next_token(&mut start); let token = match res.map_err(Token::Error).map_err(Some) { @@ -556,8 +421,8 @@ impl State { tpl_start: BytePos::DUMMY, context, syntax, - content_tag_template: ContentTagState::None, token_type: None, + content_tag_template: ContentTagState::None, } } } diff --git a/crates/swc_ecma_visit/src/generated.rs b/crates/swc_ecma_visit/src/generated.rs index d50925961e3c..26051a095970 100644 --- a/crates/swc_ecma_visit/src/generated.rs +++ b/crates/swc_ecma_visit/src/generated.rs @@ -253,6 +253,41 @@ pub trait Visit { fn visit_constructor(&mut self, node: &Constructor) { >::visit_children_with(node, self) } + #[doc = "Visit a node of type `ContentTagContent`.\n\nBy default, this method calls \ + [`ContentTagContent::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_content_tag_content(&mut self, node: &ContentTagContent) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagEnd`.\n\nBy default, this method calls \ + [`ContentTagEnd::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_content_tag_end(&mut self, node: &ContentTagEnd) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagExpression`.\n\nBy default, this method calls \ + [`ContentTagExpression::visit_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_content_tag_expression(&mut self, node: &ContentTagExpression) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagMember`.\n\nBy default, this method calls \ + [`ContentTagMember::visit_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_content_tag_member(&mut self, node: &ContentTagMember) { + >::visit_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagStart`.\n\nBy default, this method calls \ + [`ContentTagStart::visit_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn visit_content_tag_start(&mut self, node: &ContentTagStart) { + >::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."] @@ -2198,6 +2233,31 @@ where ::visit_constructor(&mut **self, node) } + #[inline] + fn visit_content_tag_content(&mut self, node: &ContentTagContent) { + ::visit_content_tag_content(&mut **self, node) + } + + #[inline] + fn visit_content_tag_end(&mut self, node: &ContentTagEnd) { + ::visit_content_tag_end(&mut **self, node) + } + + #[inline] + fn visit_content_tag_expression(&mut self, node: &ContentTagExpression) { + ::visit_content_tag_expression(&mut **self, node) + } + + #[inline] + fn visit_content_tag_member(&mut self, node: &ContentTagMember) { + ::visit_content_tag_member(&mut **self, node) + } + + #[inline] + fn visit_content_tag_start(&mut self, node: &ContentTagStart) { + ::visit_content_tag_start(&mut **self, node) + } + #[inline] fn visit_continue_stmt(&mut self, node: &ContinueStmt) { ::visit_continue_stmt(&mut **self, node) @@ -3660,6 +3720,31 @@ where ::visit_constructor(&mut **self, node) } + #[inline] + fn visit_content_tag_content(&mut self, node: &ContentTagContent) { + ::visit_content_tag_content(&mut **self, node) + } + + #[inline] + fn visit_content_tag_end(&mut self, node: &ContentTagEnd) { + ::visit_content_tag_end(&mut **self, node) + } + + #[inline] + fn visit_content_tag_expression(&mut self, node: &ContentTagExpression) { + ::visit_content_tag_expression(&mut **self, node) + } + + #[inline] + fn visit_content_tag_member(&mut self, node: &ContentTagMember) { + ::visit_content_tag_member(&mut **self, node) + } + + #[inline] + fn visit_content_tag_start(&mut self, node: &ContentTagStart) { + ::visit_content_tag_start(&mut **self, node) + } + #[inline] fn visit_continue_stmt(&mut self, node: &ContinueStmt) { ::visit_continue_stmt(&mut **self, node) @@ -5231,6 +5316,46 @@ where } } + #[inline] + fn visit_content_tag_content(&mut self, node: &ContentTagContent) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_content_tag_content(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_content_tag_content(visitor, node), + } + } + + #[inline] + fn visit_content_tag_end(&mut self, node: &ContentTagEnd) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_content_tag_end(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_content_tag_end(visitor, node), + } + } + + #[inline] + fn visit_content_tag_expression(&mut self, node: &ContentTagExpression) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_content_tag_expression(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_content_tag_expression(visitor, node), + } + } + + #[inline] + fn visit_content_tag_member(&mut self, node: &ContentTagMember) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_content_tag_member(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_content_tag_member(visitor, node), + } + } + + #[inline] + fn visit_content_tag_start(&mut self, node: &ContentTagStart) { + match self { + swc_visit::Either::Left(visitor) => Visit::visit_content_tag_start(visitor, node), + swc_visit::Either::Right(visitor) => Visit::visit_content_tag_start(visitor, node), + } + } + #[inline] fn visit_continue_stmt(&mut self, node: &ContinueStmt) { match self { @@ -7614,6 +7739,46 @@ where } } + #[inline] + fn visit_content_tag_content(&mut self, node: &ContentTagContent) { + if self.enabled { + ::visit_content_tag_content(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_content_tag_end(&mut self, node: &ContentTagEnd) { + if self.enabled { + ::visit_content_tag_end(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_content_tag_expression(&mut self, node: &ContentTagExpression) { + if self.enabled { + ::visit_content_tag_expression(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_content_tag_member(&mut self, node: &ContentTagMember) { + if self.enabled { + ::visit_content_tag_member(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_content_tag_start(&mut self, node: &ContentTagStart) { + if self.enabled { + ::visit_content_tag_start(&mut self.visitor, node) + } else { + } + } + #[inline] fn visit_continue_stmt(&mut self, node: &ContinueStmt) { if self.enabled { @@ -10371,6 +10536,9 @@ impl VisitWith for ClassMember { ClassMember::AutoAccessor { 0: _field_0 } => { >::visit_with(_field_0, visitor); } + ClassMember::ContentTagMember { 0: _field_0 } => { + >::visit_with(_field_0, visitor); + } } } } @@ -10545,6 +10713,117 @@ impl VisitWith for Constructor { } } } +impl VisitWith for ContentTagContent { + #[doc = "Calls [Visit`::visit_content_tag_content`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_content_tag_content(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ContentTagContent { span, value } => { + { + >::visit_with(span, visitor) + }; + { + >::visit_with(value, visitor) + }; + } + } + } +} +impl VisitWith for ContentTagEnd { + #[doc = "Calls [Visit`::visit_content_tag_end`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_content_tag_end(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ContentTagEnd { span } => { + { + >::visit_with(span, visitor) + }; + } + } + } +} +impl VisitWith for ContentTagExpression { + #[doc = "Calls [Visit`::visit_content_tag_expression`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_content_tag_expression(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ContentTagExpression { + span, + opening, + contents, + closing, + } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(opening, visitor) + }; + { + as VisitWith>::visit_with(contents, visitor) + }; + { + as VisitWith>::visit_with(closing, visitor) + }; + } + } + } +} +impl VisitWith for ContentTagMember { + #[doc = "Calls [Visit`::visit_content_tag_member`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_content_tag_member(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ContentTagMember { + span, + opening, + contents, + closing, + } => { + { + >::visit_with(span, visitor) + }; + { + as VisitWith>::visit_with(opening, visitor) + }; + { + as VisitWith>::visit_with(contents, visitor) + }; + { + as VisitWith>::visit_with(closing, visitor) + }; + } + } + } +} +impl VisitWith for ContentTagStart { + #[doc = "Calls [Visit`::visit_content_tag_start`] with `self`."] + fn visit_with(&self, visitor: &mut V) { + ::visit_content_tag_start(visitor, self) + } + + fn visit_children_with(&self, visitor: &mut V) { + match self { + ContentTagStart { span } => { + { + >::visit_with(span, visitor) + }; + } + } + } +} impl VisitWith for ContinueStmt { #[doc = "Calls [Visit`::visit_continue_stmt`] with `self`."] fn visit_with(&self, visitor: &mut V) { @@ -10953,6 +11232,9 @@ impl VisitWith for Expr { Expr::JSXFragment { 0: _field_0 } => { >::visit_with(_field_0, visitor); } + Expr::ContentTagExpression { 0: _field_0 } => { + >::visit_with(_field_0, visitor); + } Expr::TsTypeAssertion { 0: _field_0 } => { >::visit_with(_field_0, visitor); } @@ -16629,6 +16911,71 @@ pub trait VisitAstPath { node, self, __ast_path, ) } + #[doc = "Visit a node of type `ContentTagContent`.\n\nBy default, this method calls \ + [`ContentTagContent::visit_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_content_tag_content<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagContent, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagEnd`.\n\nBy default, this method calls \ + [`ContentTagEnd::visit_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_content_tag_end<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagEnd, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagExpression`.\n\nBy default, this method calls \ + [`ContentTagExpression::visit_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_content_tag_expression<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagExpression, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagMember`.\n\nBy default, this method calls \ + [`ContentTagMember::visit_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_content_tag_member<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagMember, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagStart`.\n\nBy default, this method calls \ + [`ContentTagStart::visit_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_content_tag_start<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagStart, + __ast_path: &mut AstNodePath<'r>, + ) { + >::visit_children_with_ast_path( + node, self, __ast_path, + ) + } #[doc = "Visit a node of type `ContinueStmt`.\n\nBy default, this method calls \ [`ContinueStmt::visit_children_with_ast_path`]. If you want to recurse, you need to \ call it manually."] @@ -19998,6 +20345,51 @@ where ::visit_constructor(&mut **self, node, __ast_path) } + #[inline] + fn visit_content_tag_content<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagContent, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_content(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_end<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagEnd, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_end(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_expression<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagExpression, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_expression(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_member<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagMember, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_member(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_start<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagStart, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_start(&mut **self, node, __ast_path) + } + #[inline] fn visit_continue_stmt<'ast: 'r, 'r>( &mut self, @@ -22527,6 +22919,51 @@ where ::visit_constructor(&mut **self, node, __ast_path) } + #[inline] + fn visit_content_tag_content<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagContent, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_content(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_end<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagEnd, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_end(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_expression<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagExpression, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_expression(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_member<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagMember, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_member(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_content_tag_start<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagStart, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_start(&mut **self, node, __ast_path) + } + #[inline] fn visit_continue_stmt<'ast: 'r, 'r>( &mut self, @@ -25305,6 +25742,86 @@ where } } + #[inline] + fn visit_content_tag_content<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagContent, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_content_tag_content(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_content_tag_content(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_content_tag_end<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagEnd, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_content_tag_end(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_content_tag_end(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_content_tag_expression<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagExpression, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_content_tag_expression(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_content_tag_expression(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_content_tag_member<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagMember, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_content_tag_member(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_content_tag_member(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_content_tag_start<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagStart, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitAstPath::visit_content_tag_start(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitAstPath::visit_content_tag_start(visitor, node, __ast_path) + } + } + } + #[inline] fn visit_continue_stmt<'ast: 'r, 'r>( &mut self, @@ -29693,6 +30210,66 @@ where } } + #[inline] + fn visit_content_tag_content<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagContent, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_content_tag_content(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_content_tag_end<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagEnd, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_content_tag_end(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_content_tag_expression<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagExpression, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_content_tag_expression(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_content_tag_member<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagMember, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_content_tag_member(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_content_tag_start<'ast: 'r, 'r>( + &mut self, + node: &'ast ContentTagStart, + __ast_path: &mut AstNodePath<'r>, + ) { + if self.enabled { + ::visit_content_tag_start(&mut self.visitor, node, __ast_path) + } else { + } + } + #[inline] fn visit_continue_stmt<'ast: 'r, 'r>( &mut self, @@ -34370,6 +34947,17 @@ impl VisitWithAstPath for ClassMember { &mut *__ast_path, ); } + ClassMember::ContentTagMember { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ClassMember( + self, + self::fields::ClassMemberField::ContentTagMember, + )); + >::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } } } } @@ -34780,6 +35368,269 @@ impl VisitWithAstPath for Constructor { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ContentTagContent { + #[doc = "Calls [VisitAstPath`::visit_content_tag_content`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_content(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ContentTagContent { span, value } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ContentTagContent( + self, + self::fields::ContentTagContentField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ContentTagContent( + self, + self::fields::ContentTagContentField::Value, + )); + >::visit_with_ast_path( + value, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ContentTagEnd { + #[doc = "Calls [VisitAstPath`::visit_content_tag_end`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_end(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ContentTagEnd { span } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ContentTagEnd( + self, + self::fields::ContentTagEndField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ContentTagExpression { + #[doc = "Calls [VisitAstPath`::visit_content_tag_expression`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_expression(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ContentTagExpression { + span, + opening, + contents, + closing, + } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ContentTagExpression( + self, + self::fields::ContentTagExpressionField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ContentTagExpression( + self, + self::fields::ContentTagExpressionField::Opening, + )); + as VisitWithAstPath>::visit_with_ast_path( + opening, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ContentTagExpression( + self, + self::fields::ContentTagExpressionField::Contents, + )); + as VisitWithAstPath>::visit_with_ast_path( + contents, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentNodeRef::ContentTagExpression( + self, + self::fields::ContentTagExpressionField::Closing, + )); + as VisitWithAstPath>::visit_with_ast_path( + closing, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ContentTagMember { + #[doc = "Calls [VisitAstPath`::visit_content_tag_member`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_member(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ContentTagMember { + span, + opening, + contents, + closing, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ContentTagMember( + self, + self::fields::ContentTagMemberField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ContentTagMember( + self, + self::fields::ContentTagMemberField::Opening, + )); + as VisitWithAstPath>::visit_with_ast_path( + opening, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ContentTagMember( + self, + self::fields::ContentTagMemberField::Contents, + )); + as VisitWithAstPath>::visit_with_ast_path( + contents, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ContentTagMember( + self, + self::fields::ContentTagMemberField::Closing, + )); + as VisitWithAstPath>::visit_with_ast_path( + closing, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitWithAstPath for ContentTagStart { + #[doc = "Calls [VisitAstPath`::visit_content_tag_start`] with `self`."] + fn visit_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + ::visit_content_tag_start(visitor, self, __ast_path) + } + + fn visit_children_with_ast_path<'ast: 'r, 'r>( + &'ast self, + visitor: &mut V, + __ast_path: &mut AstNodePath<'r>, + ) { + match self { + ContentTagStart { span } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ContentTagStart( + self, + self::fields::ContentTagStartField::Span, + )); + >::visit_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl VisitWithAstPath for ContinueStmt { #[doc = "Calls [VisitAstPath`::visit_continue_stmt`] with `self`."] fn visit_with_ast_path<'ast: 'r, 'r>( @@ -35850,6 +36701,17 @@ impl VisitWithAstPath for Expr { &mut *__ast_path, ); } + Expr::ContentTagExpression { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Expr( + self, + self::fields::ExprField::ContentTagExpression, + )); + >::visit_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } Expr::TsTypeAssertion { 0: _field_0 } => { let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Expr( self, @@ -48509,6 +49371,41 @@ pub trait VisitMut { fn visit_mut_constructor(&mut self, node: &mut Constructor) { >::visit_mut_children_with(node, self) } + #[doc = "Visit a node of type `ContentTagContent`.\n\nBy default, this method calls \ + [`ContentTagContent::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_content_tag_content(&mut self, node: &mut ContentTagContent) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagEnd`.\n\nBy default, this method calls \ + [`ContentTagEnd::visit_mut_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn visit_mut_content_tag_end(&mut self, node: &mut ContentTagEnd) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagExpression`.\n\nBy default, this method calls \ + [`ContentTagExpression::visit_mut_children_with`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_content_tag_expression(&mut self, node: &mut ContentTagExpression) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagMember`.\n\nBy default, this method calls \ + [`ContentTagMember::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_content_tag_member(&mut self, node: &mut ContentTagMember) { + >::visit_mut_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagStart`.\n\nBy default, this method calls \ + [`ContentTagStart::visit_mut_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn visit_mut_content_tag_start(&mut self, node: &mut ContentTagStart) { + >::visit_mut_children_with(node, self) + } #[doc = "Visit a node of type `ContinueStmt`.\n\nBy default, this method calls \ [`ContinueStmt::visit_mut_children_with`]. If you want to recurse, you need to call \ it manually."] @@ -50481,6 +51378,31 @@ where ::visit_mut_constructor(&mut **self, node) } + #[inline] + fn visit_mut_content_tag_content(&mut self, node: &mut ContentTagContent) { + ::visit_mut_content_tag_content(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_end(&mut self, node: &mut ContentTagEnd) { + ::visit_mut_content_tag_end(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_expression(&mut self, node: &mut ContentTagExpression) { + ::visit_mut_content_tag_expression(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_member(&mut self, node: &mut ContentTagMember) { + ::visit_mut_content_tag_member(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_start(&mut self, node: &mut ContentTagStart) { + ::visit_mut_content_tag_start(&mut **self, node) + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt) { ::visit_mut_continue_stmt(&mut **self, node) @@ -51943,6 +52865,31 @@ where ::visit_mut_constructor(&mut **self, node) } + #[inline] + fn visit_mut_content_tag_content(&mut self, node: &mut ContentTagContent) { + ::visit_mut_content_tag_content(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_end(&mut self, node: &mut ContentTagEnd) { + ::visit_mut_content_tag_end(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_expression(&mut self, node: &mut ContentTagExpression) { + ::visit_mut_content_tag_expression(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_member(&mut self, node: &mut ContentTagMember) { + ::visit_mut_content_tag_member(&mut **self, node) + } + + #[inline] + fn visit_mut_content_tag_start(&mut self, node: &mut ContentTagStart) { + ::visit_mut_content_tag_start(&mut **self, node) + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt) { ::visit_mut_continue_stmt(&mut **self, node) @@ -53526,6 +54473,62 @@ where } } + #[inline] + fn visit_mut_content_tag_content(&mut self, node: &mut ContentTagContent) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_content_tag_content(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_content_tag_content(visitor, node) + } + } + } + + #[inline] + fn visit_mut_content_tag_end(&mut self, node: &mut ContentTagEnd) { + match self { + swc_visit::Either::Left(visitor) => VisitMut::visit_mut_content_tag_end(visitor, node), + swc_visit::Either::Right(visitor) => VisitMut::visit_mut_content_tag_end(visitor, node), + } + } + + #[inline] + fn visit_mut_content_tag_expression(&mut self, node: &mut ContentTagExpression) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_content_tag_expression(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_content_tag_expression(visitor, node) + } + } + } + + #[inline] + fn visit_mut_content_tag_member(&mut self, node: &mut ContentTagMember) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_content_tag_member(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_content_tag_member(visitor, node) + } + } + } + + #[inline] + fn visit_mut_content_tag_start(&mut self, node: &mut ContentTagStart) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMut::visit_mut_content_tag_start(visitor, node) + } + swc_visit::Either::Right(visitor) => { + VisitMut::visit_mut_content_tag_start(visitor, node) + } + } + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt) { match self { @@ -56201,6 +57204,46 @@ where } } + #[inline] + fn visit_mut_content_tag_content(&mut self, node: &mut ContentTagContent) { + if self.enabled { + ::visit_mut_content_tag_content(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_end(&mut self, node: &mut ContentTagEnd) { + if self.enabled { + ::visit_mut_content_tag_end(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_expression(&mut self, node: &mut ContentTagExpression) { + if self.enabled { + ::visit_mut_content_tag_expression(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_member(&mut self, node: &mut ContentTagMember) { + if self.enabled { + ::visit_mut_content_tag_member(&mut self.visitor, node) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_start(&mut self, node: &mut ContentTagStart) { + if self.enabled { + ::visit_mut_content_tag_start(&mut self.visitor, node) + } else { + } + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt) { if self.enabled { @@ -58972,6 +60015,9 @@ impl VisitMutWith for ClassMember { ClassMember::AutoAccessor { 0: _field_0 } => { >::visit_mut_with(_field_0, visitor); } + ClassMember::ContentTagMember { 0: _field_0 } => { + >::visit_mut_with(_field_0, visitor); + } } } } @@ -59155,6 +60201,117 @@ impl VisitMutWith for Constructor { } } } +impl VisitMutWith for ContentTagContent { + #[doc = "Calls [VisitMut`::visit_mut_content_tag_content`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_content_tag_content(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ContentTagContent { span, value } => { + { + >::visit_mut_with(span, visitor) + }; + { + >::visit_mut_with(value, visitor) + }; + } + } + } +} +impl VisitMutWith for ContentTagEnd { + #[doc = "Calls [VisitMut`::visit_mut_content_tag_end`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_content_tag_end(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ContentTagEnd { span } => { + { + >::visit_mut_with(span, visitor) + }; + } + } + } +} +impl VisitMutWith for ContentTagExpression { + #[doc = "Calls [VisitMut`::visit_mut_content_tag_expression`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_content_tag_expression(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ContentTagExpression { + span, + opening, + contents, + closing, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(opening, visitor) + }; + { + as VisitMutWith>::visit_mut_with(contents, visitor) + }; + { + as VisitMutWith>::visit_mut_with(closing, visitor) + }; + } + } + } +} +impl VisitMutWith for ContentTagMember { + #[doc = "Calls [VisitMut`::visit_mut_content_tag_member`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_content_tag_member(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ContentTagMember { + span, + opening, + contents, + closing, + } => { + { + >::visit_mut_with(span, visitor) + }; + { + as VisitMutWith>::visit_mut_with(opening, visitor) + }; + { + as VisitMutWith>::visit_mut_with(contents, visitor) + }; + { + as VisitMutWith>::visit_mut_with(closing, visitor) + }; + } + } + } +} +impl VisitMutWith for ContentTagStart { + #[doc = "Calls [VisitMut`::visit_mut_content_tag_start`] with `self`."] + fn visit_mut_with(&mut self, visitor: &mut V) { + ::visit_mut_content_tag_start(visitor, self) + } + + fn visit_mut_children_with(&mut self, visitor: &mut V) { + match self { + ContentTagStart { span } => { + { + >::visit_mut_with(span, visitor) + }; + } + } + } +} impl VisitMutWith for ContinueStmt { #[doc = "Calls [VisitMut`::visit_mut_continue_stmt`] with `self`."] fn visit_mut_with(&mut self, visitor: &mut V) { @@ -59563,6 +60720,9 @@ impl VisitMutWith for Expr { Expr::JSXFragment { 0: _field_0 } => { >::visit_mut_with(_field_0, visitor); } + Expr::ContentTagExpression { 0: _field_0 } => { + >::visit_mut_with(_field_0, visitor); + } Expr::TsTypeAssertion { 0: _field_0 } => { >::visit_mut_with(_field_0, visitor); } @@ -65194,6 +66354,71 @@ pub trait VisitMutAstPath { node, self, __ast_path, ) } + #[doc = "Visit a node of type `ContentTagContent`.\n\nBy default, this method calls \ + [`ContentTagContent::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_content_tag_content( + &mut self, + node: &mut ContentTagContent, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagEnd`.\n\nBy default, this method calls \ + [`ContentTagEnd::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn visit_mut_content_tag_end( + &mut self, + node: &mut ContentTagEnd, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagExpression`.\n\nBy default, this method calls \ + [`ContentTagExpression::visit_mut_children_with_ast_path`]. If you want to recurse, \ + you need to call it manually."] + #[inline] + fn visit_mut_content_tag_expression( + &mut self, + node: &mut ContentTagExpression, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagMember`.\n\nBy default, this method calls \ + [`ContentTagMember::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_content_tag_member( + &mut self, + node: &mut ContentTagMember, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagStart`.\n\nBy default, this method calls \ + [`ContentTagStart::visit_mut_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn visit_mut_content_tag_start( + &mut self, + node: &mut ContentTagStart, + __ast_path: &mut AstKindPath, + ) { + >::visit_mut_children_with_ast_path( + node, self, __ast_path, + ) + } #[doc = "Visit a node of type `ContinueStmt`.\n\nBy default, this method calls \ [`ContinueStmt::visit_mut_children_with_ast_path`]. If you want to recurse, you need \ to call it manually."] @@ -68131,6 +69356,51 @@ where ::visit_mut_constructor(&mut **self, node, __ast_path) } + #[inline] + fn visit_mut_content_tag_content( + &mut self, + node: &mut ContentTagContent, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_content(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_end( + &mut self, + node: &mut ContentTagEnd, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_end(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_expression( + &mut self, + node: &mut ContentTagExpression, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_expression(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_member( + &mut self, + node: &mut ContentTagMember, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_member(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_start( + &mut self, + node: &mut ContentTagStart, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_start(&mut **self, node, __ast_path) + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt, __ast_path: &mut AstKindPath) { ::visit_mut_continue_stmt(&mut **self, node, __ast_path) @@ -70068,6 +71338,51 @@ where ::visit_mut_constructor(&mut **self, node, __ast_path) } + #[inline] + fn visit_mut_content_tag_content( + &mut self, + node: &mut ContentTagContent, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_content(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_end( + &mut self, + node: &mut ContentTagEnd, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_end(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_expression( + &mut self, + node: &mut ContentTagExpression, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_expression(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_member( + &mut self, + node: &mut ContentTagMember, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_member(&mut **self, node, __ast_path) + } + + #[inline] + fn visit_mut_content_tag_start( + &mut self, + node: &mut ContentTagStart, + __ast_path: &mut AstKindPath, + ) { + ::visit_mut_content_tag_start(&mut **self, node, __ast_path) + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt, __ast_path: &mut AstKindPath) { ::visit_mut_continue_stmt(&mut **self, node, __ast_path) @@ -72258,6 +73573,86 @@ where } } + #[inline] + fn visit_mut_content_tag_content( + &mut self, + node: &mut ContentTagContent, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_content_tag_content(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_content_tag_content(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_content_tag_end( + &mut self, + node: &mut ContentTagEnd, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_content_tag_end(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_content_tag_end(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_content_tag_expression( + &mut self, + node: &mut ContentTagExpression, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_content_tag_expression(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_content_tag_expression(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_content_tag_member( + &mut self, + node: &mut ContentTagMember, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_content_tag_member(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_content_tag_member(visitor, node, __ast_path) + } + } + } + + #[inline] + fn visit_mut_content_tag_start( + &mut self, + node: &mut ContentTagStart, + __ast_path: &mut AstKindPath, + ) { + match self { + swc_visit::Either::Left(visitor) => { + VisitMutAstPath::visit_mut_content_tag_start(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + VisitMutAstPath::visit_mut_content_tag_start(visitor, node, __ast_path) + } + } + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt, __ast_path: &mut AstKindPath) { match self { @@ -76092,6 +77487,78 @@ where } } + #[inline] + fn visit_mut_content_tag_content( + &mut self, + node: &mut ContentTagContent, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_content_tag_content( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_end( + &mut self, + node: &mut ContentTagEnd, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_content_tag_end(&mut self.visitor, node, __ast_path) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_expression( + &mut self, + node: &mut ContentTagExpression, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_content_tag_expression( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_member( + &mut self, + node: &mut ContentTagMember, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_content_tag_member( + &mut self.visitor, + node, + __ast_path, + ) + } else { + } + } + + #[inline] + fn visit_mut_content_tag_start( + &mut self, + node: &mut ContentTagStart, + __ast_path: &mut AstKindPath, + ) { + if self.enabled { + ::visit_mut_content_tag_start(&mut self.visitor, node, __ast_path) + } else { + } + } + #[inline] fn visit_mut_continue_stmt(&mut self, node: &mut ContinueStmt, __ast_path: &mut AstKindPath) { if self.enabled { @@ -80154,6 +81621,16 @@ impl VisitMutWithAstPath for ClassMember { &mut *__ast_path, ); } + ClassMember::ContentTagMember { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassMember( + self::fields::ClassMemberField::ContentTagMember, + )); + >::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } } } } @@ -80495,6 +81972,215 @@ impl VisitMutWithAstPath for Constructor { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ContentTagContent { + #[doc = "Calls [VisitMutAstPath`::visit_mut_content_tag_content`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_content_tag_content(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ContentTagContent { span, value } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagContent( + self::fields::ContentTagContentField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagContent( + self::fields::ContentTagContentField::Value, + )); + >::visit_mut_with_ast_path( + value, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ContentTagEnd { + #[doc = "Calls [VisitMutAstPath`::visit_mut_content_tag_end`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_content_tag_end(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ContentTagEnd { span } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagEnd( + self::fields::ContentTagEndField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ContentTagExpression { + #[doc = "Calls [VisitMutAstPath`::visit_mut_content_tag_expression`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_content_tag_expression(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ContentTagExpression { + span, + opening, + contents, + closing, + } => { + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Opening, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + opening, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Contents, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + contents, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Closing, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + closing, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ContentTagMember { + #[doc = "Calls [VisitMutAstPath`::visit_mut_content_tag_member`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_content_tag_member(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ContentTagMember { + span, + opening, + contents, + closing, + } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Opening, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + opening, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Contents, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + contents, + visitor, + &mut *__ast_path, + ) + }; + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Closing, + )); + as VisitMutWithAstPath>::visit_mut_with_ast_path( + closing, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl VisitMutWithAstPath for ContentTagStart { + #[doc = "Calls [VisitMutAstPath`::visit_mut_content_tag_start`] with `self`."] + fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + ::visit_mut_content_tag_start(visitor, self, __ast_path) + } + + fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { + match self { + ContentTagStart { span } => { + { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagStart( + self::fields::ContentTagStartField::Span, + )); + >::visit_mut_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl VisitMutWithAstPath for ContinueStmt { #[doc = "Calls [VisitMutAstPath`::visit_mut_continue_stmt`] with `self`."] fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) { @@ -81366,6 +83052,16 @@ impl VisitMutWithAstPath for Expr { &mut *__ast_path, ); } + Expr::ContentTagExpression { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Expr( + self::fields::ExprField::ContentTagExpression, + )); + >::visit_mut_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + } Expr::TsTypeAssertion { 0: _field_0 } => { let mut __ast_path = __ast_path.with_guard(AstParentKind::Expr( self::fields::ExprField::TsTypeAssertion, @@ -91324,6 +93020,41 @@ pub trait Fold { fn fold_constructor(&mut self, node: Constructor) -> Constructor { >::fold_children_with(node, self) } + #[doc = "Visit a node of type `ContentTagContent`.\n\nBy default, this method calls \ + [`ContentTagContent::fold_children_with`]. If you want to recurse, you need to call \ + it manually."] + #[inline] + fn fold_content_tag_content(&mut self, node: ContentTagContent) -> ContentTagContent { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagEnd`.\n\nBy default, this method calls \ + [`ContentTagEnd::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_content_tag_end(&mut self, node: ContentTagEnd) -> ContentTagEnd { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagExpression`.\n\nBy default, this method calls \ + [`ContentTagExpression::fold_children_with`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_content_tag_expression(&mut self, node: ContentTagExpression) -> ContentTagExpression { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagMember`.\n\nBy default, this method calls \ + [`ContentTagMember::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_content_tag_member(&mut self, node: ContentTagMember) -> ContentTagMember { + >::fold_children_with(node, self) + } + #[doc = "Visit a node of type `ContentTagStart`.\n\nBy default, this method calls \ + [`ContentTagStart::fold_children_with`]. If you want to recurse, you need to call it \ + manually."] + #[inline] + fn fold_content_tag_start(&mut self, node: ContentTagStart) -> ContentTagStart { + >::fold_children_with(node, self) + } #[doc = "Visit a node of type `ContinueStmt`.\n\nBy default, this method calls \ [`ContinueStmt::fold_children_with`]. If you want to recurse, you need to call it \ manually."] @@ -93309,6 +95040,31 @@ where ::fold_constructor(&mut **self, node) } + #[inline] + fn fold_content_tag_content(&mut self, node: ContentTagContent) -> ContentTagContent { + ::fold_content_tag_content(&mut **self, node) + } + + #[inline] + fn fold_content_tag_end(&mut self, node: ContentTagEnd) -> ContentTagEnd { + ::fold_content_tag_end(&mut **self, node) + } + + #[inline] + fn fold_content_tag_expression(&mut self, node: ContentTagExpression) -> ContentTagExpression { + ::fold_content_tag_expression(&mut **self, node) + } + + #[inline] + fn fold_content_tag_member(&mut self, node: ContentTagMember) -> ContentTagMember { + ::fold_content_tag_member(&mut **self, node) + } + + #[inline] + fn fold_content_tag_start(&mut self, node: ContentTagStart) -> ContentTagStart { + ::fold_content_tag_start(&mut **self, node) + } + #[inline] fn fold_continue_stmt(&mut self, node: ContinueStmt) -> ContinueStmt { ::fold_continue_stmt(&mut **self, node) @@ -94825,6 +96581,31 @@ where ::fold_constructor(&mut **self, node) } + #[inline] + fn fold_content_tag_content(&mut self, node: ContentTagContent) -> ContentTagContent { + ::fold_content_tag_content(&mut **self, node) + } + + #[inline] + fn fold_content_tag_end(&mut self, node: ContentTagEnd) -> ContentTagEnd { + ::fold_content_tag_end(&mut **self, node) + } + + #[inline] + fn fold_content_tag_expression(&mut self, node: ContentTagExpression) -> ContentTagExpression { + ::fold_content_tag_expression(&mut **self, node) + } + + #[inline] + fn fold_content_tag_member(&mut self, node: ContentTagMember) -> ContentTagMember { + ::fold_content_tag_member(&mut **self, node) + } + + #[inline] + fn fold_content_tag_start(&mut self, node: ContentTagStart) -> ContentTagStart { + ::fold_content_tag_start(&mut **self, node) + } + #[inline] fn fold_continue_stmt(&mut self, node: ContinueStmt) -> ContinueStmt { ::fold_continue_stmt(&mut **self, node) @@ -96450,6 +98231,46 @@ where } } + #[inline] + fn fold_content_tag_content(&mut self, node: ContentTagContent) -> ContentTagContent { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_content_tag_content(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_content_tag_content(visitor, node), + } + } + + #[inline] + fn fold_content_tag_end(&mut self, node: ContentTagEnd) -> ContentTagEnd { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_content_tag_end(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_content_tag_end(visitor, node), + } + } + + #[inline] + fn fold_content_tag_expression(&mut self, node: ContentTagExpression) -> ContentTagExpression { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_content_tag_expression(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_content_tag_expression(visitor, node), + } + } + + #[inline] + fn fold_content_tag_member(&mut self, node: ContentTagMember) -> ContentTagMember { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_content_tag_member(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_content_tag_member(visitor, node), + } + } + + #[inline] + fn fold_content_tag_start(&mut self, node: ContentTagStart) -> ContentTagStart { + match self { + swc_visit::Either::Left(visitor) => Fold::fold_content_tag_start(visitor, node), + swc_visit::Either::Right(visitor) => Fold::fold_content_tag_start(visitor, node), + } + } + #[inline] fn fold_continue_stmt(&mut self, node: ContinueStmt) -> ContinueStmt { match self { @@ -98897,6 +100718,51 @@ where } } + #[inline] + fn fold_content_tag_content(&mut self, node: ContentTagContent) -> ContentTagContent { + if self.enabled { + ::fold_content_tag_content(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_content_tag_end(&mut self, node: ContentTagEnd) -> ContentTagEnd { + if self.enabled { + ::fold_content_tag_end(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_content_tag_expression(&mut self, node: ContentTagExpression) -> ContentTagExpression { + if self.enabled { + ::fold_content_tag_expression(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_content_tag_member(&mut self, node: ContentTagMember) -> ContentTagMember { + if self.enabled { + ::fold_content_tag_member(&mut self.visitor, node) + } else { + node + } + } + + #[inline] + fn fold_content_tag_start(&mut self, node: ContentTagStart) -> ContentTagStart { + if self.enabled { + ::fold_content_tag_start(&mut self.visitor, node) + } else { + node + } + } + #[inline] fn fold_continue_stmt(&mut self, node: ContinueStmt) -> ContinueStmt { if self.enabled { @@ -101941,6 +103807,10 @@ impl FoldWith for ClassMember { let _field_0 = >::fold_with(_field_0, visitor); ClassMember::AutoAccessor { 0: _field_0 } } + ClassMember::ContentTagMember { 0: _field_0 } => { + let _field_0 = >::fold_with(_field_0, visitor); + ClassMember::ContentTagMember { 0: _field_0 } + } } } } @@ -102117,6 +103987,112 @@ impl FoldWith for Constructor { } } } +impl FoldWith for ContentTagContent { + #[doc = "Calls [Fold`::fold_content_tag_content`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_content_tag_content(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ContentTagContent { span, value } => { + let span = { >::fold_with(span, visitor) }; + let value = { >::fold_with(value, visitor) }; + ContentTagContent { span, value } + } + } + } +} +impl FoldWith for ContentTagEnd { + #[doc = "Calls [Fold`::fold_content_tag_end`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_content_tag_end(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ContentTagEnd { span } => { + let span = { >::fold_with(span, visitor) }; + ContentTagEnd { span } + } + } + } +} +impl FoldWith for ContentTagExpression { + #[doc = "Calls [Fold`::fold_content_tag_expression`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_content_tag_expression(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ContentTagExpression { + span, + opening, + contents, + closing, + } => { + let span = { >::fold_with(span, visitor) }; + let opening = + { as FoldWith>::fold_with(opening, visitor) }; + let contents = + { as FoldWith>::fold_with(contents, visitor) }; + let closing = { as FoldWith>::fold_with(closing, visitor) }; + ContentTagExpression { + span, + opening, + contents, + closing, + } + } + } + } +} +impl FoldWith for ContentTagMember { + #[doc = "Calls [Fold`::fold_content_tag_member`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_content_tag_member(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ContentTagMember { + span, + opening, + contents, + closing, + } => { + let span = { >::fold_with(span, visitor) }; + let opening = + { as FoldWith>::fold_with(opening, visitor) }; + let contents = + { as FoldWith>::fold_with(contents, visitor) }; + let closing = { as FoldWith>::fold_with(closing, visitor) }; + ContentTagMember { + span, + opening, + contents, + closing, + } + } + } + } +} +impl FoldWith for ContentTagStart { + #[doc = "Calls [Fold`::fold_content_tag_start`] with `self`."] + fn fold_with(self, visitor: &mut V) -> Self { + ::fold_content_tag_start(visitor, self) + } + + fn fold_children_with(self, visitor: &mut V) -> Self { + match self { + ContentTagStart { span } => { + let span = { >::fold_with(span, visitor) }; + ContentTagStart { span } + } + } + } +} impl FoldWith for ContinueStmt { #[doc = "Calls [Fold`::fold_continue_stmt`] with `self`."] fn fold_with(self, visitor: &mut V) -> Self { @@ -102545,6 +104521,10 @@ impl FoldWith for Expr { let _field_0 = >::fold_with(_field_0, visitor); Expr::JSXFragment { 0: _field_0 } } + Expr::ContentTagExpression { 0: _field_0 } => { + let _field_0 = >::fold_with(_field_0, visitor); + Expr::ContentTagExpression { 0: _field_0 } + } Expr::TsTypeAssertion { 0: _field_0 } => { let _field_0 = >::fold_with(_field_0, visitor); Expr::TsTypeAssertion { 0: _field_0 } @@ -108036,6 +110016,71 @@ pub trait FoldAstPath { fn fold_constructor(&mut self, node: Constructor, __ast_path: &mut AstKindPath) -> Constructor { >::fold_children_with_ast_path(node, self, __ast_path) } + #[doc = "Visit a node of type `ContentTagContent`.\n\nBy default, this method calls \ + [`ContentTagContent::fold_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_content_tag_content( + &mut self, + node: ContentTagContent, + __ast_path: &mut AstKindPath, + ) -> ContentTagContent { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagEnd`.\n\nBy default, this method calls \ + [`ContentTagEnd::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_content_tag_end( + &mut self, + node: ContentTagEnd, + __ast_path: &mut AstKindPath, + ) -> ContentTagEnd { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagExpression`.\n\nBy default, this method calls \ + [`ContentTagExpression::fold_children_with_ast_path`]. If you want to recurse, you \ + need to call it manually."] + #[inline] + fn fold_content_tag_expression( + &mut self, + node: ContentTagExpression, + __ast_path: &mut AstKindPath, + ) -> ContentTagExpression { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagMember`.\n\nBy default, this method calls \ + [`ContentTagMember::fold_children_with_ast_path`]. If you want to recurse, you need \ + to call it manually."] + #[inline] + fn fold_content_tag_member( + &mut self, + node: ContentTagMember, + __ast_path: &mut AstKindPath, + ) -> ContentTagMember { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } + #[doc = "Visit a node of type `ContentTagStart`.\n\nBy default, this method calls \ + [`ContentTagStart::fold_children_with_ast_path`]. If you want to recurse, you need to \ + call it manually."] + #[inline] + fn fold_content_tag_start( + &mut self, + node: ContentTagStart, + __ast_path: &mut AstKindPath, + ) -> ContentTagStart { + >::fold_children_with_ast_path( + node, self, __ast_path, + ) + } #[doc = "Visit a node of type `ContinueStmt`.\n\nBy default, this method calls \ [`ContinueStmt::fold_children_with_ast_path`]. If you want to recurse, you need to \ call it manually."] @@ -110969,6 +113014,51 @@ where ::fold_constructor(&mut **self, node, __ast_path) } + #[inline] + fn fold_content_tag_content( + &mut self, + node: ContentTagContent, + __ast_path: &mut AstKindPath, + ) -> ContentTagContent { + ::fold_content_tag_content(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_end( + &mut self, + node: ContentTagEnd, + __ast_path: &mut AstKindPath, + ) -> ContentTagEnd { + ::fold_content_tag_end(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_expression( + &mut self, + node: ContentTagExpression, + __ast_path: &mut AstKindPath, + ) -> ContentTagExpression { + ::fold_content_tag_expression(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_member( + &mut self, + node: ContentTagMember, + __ast_path: &mut AstKindPath, + ) -> ContentTagMember { + ::fold_content_tag_member(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_start( + &mut self, + node: ContentTagStart, + __ast_path: &mut AstKindPath, + ) -> ContentTagStart { + ::fold_content_tag_start(&mut **self, node, __ast_path) + } + #[inline] fn fold_continue_stmt( &mut self, @@ -113138,6 +115228,51 @@ where ::fold_constructor(&mut **self, node, __ast_path) } + #[inline] + fn fold_content_tag_content( + &mut self, + node: ContentTagContent, + __ast_path: &mut AstKindPath, + ) -> ContentTagContent { + ::fold_content_tag_content(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_end( + &mut self, + node: ContentTagEnd, + __ast_path: &mut AstKindPath, + ) -> ContentTagEnd { + ::fold_content_tag_end(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_expression( + &mut self, + node: ContentTagExpression, + __ast_path: &mut AstKindPath, + ) -> ContentTagExpression { + ::fold_content_tag_expression(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_member( + &mut self, + node: ContentTagMember, + __ast_path: &mut AstKindPath, + ) -> ContentTagMember { + ::fold_content_tag_member(&mut **self, node, __ast_path) + } + + #[inline] + fn fold_content_tag_start( + &mut self, + node: ContentTagStart, + __ast_path: &mut AstKindPath, + ) -> ContentTagStart { + ::fold_content_tag_start(&mut **self, node, __ast_path) + } + #[inline] fn fold_continue_stmt( &mut self, @@ -115546,6 +117681,86 @@ where } } + #[inline] + fn fold_content_tag_content( + &mut self, + node: ContentTagContent, + __ast_path: &mut AstKindPath, + ) -> ContentTagContent { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_content_tag_content(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_content_tag_content(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_content_tag_end( + &mut self, + node: ContentTagEnd, + __ast_path: &mut AstKindPath, + ) -> ContentTagEnd { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_content_tag_end(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_content_tag_end(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_content_tag_expression( + &mut self, + node: ContentTagExpression, + __ast_path: &mut AstKindPath, + ) -> ContentTagExpression { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_content_tag_expression(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_content_tag_expression(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_content_tag_member( + &mut self, + node: ContentTagMember, + __ast_path: &mut AstKindPath, + ) -> ContentTagMember { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_content_tag_member(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_content_tag_member(visitor, node, __ast_path) + } + } + } + + #[inline] + fn fold_content_tag_start( + &mut self, + node: ContentTagStart, + __ast_path: &mut AstKindPath, + ) -> ContentTagStart { + match self { + swc_visit::Either::Left(visitor) => { + FoldAstPath::fold_content_tag_start(visitor, node, __ast_path) + } + swc_visit::Either::Right(visitor) => { + FoldAstPath::fold_content_tag_start(visitor, node, __ast_path) + } + } + } + #[inline] fn fold_continue_stmt( &mut self, @@ -119560,6 +121775,71 @@ where } } + #[inline] + fn fold_content_tag_content( + &mut self, + node: ContentTagContent, + __ast_path: &mut AstKindPath, + ) -> ContentTagContent { + if self.enabled { + ::fold_content_tag_content(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_content_tag_end( + &mut self, + node: ContentTagEnd, + __ast_path: &mut AstKindPath, + ) -> ContentTagEnd { + if self.enabled { + ::fold_content_tag_end(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_content_tag_expression( + &mut self, + node: ContentTagExpression, + __ast_path: &mut AstKindPath, + ) -> ContentTagExpression { + if self.enabled { + ::fold_content_tag_expression(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_content_tag_member( + &mut self, + node: ContentTagMember, + __ast_path: &mut AstKindPath, + ) -> ContentTagMember { + if self.enabled { + ::fold_content_tag_member(&mut self.visitor, node, __ast_path) + } else { + node + } + } + + #[inline] + fn fold_content_tag_start( + &mut self, + node: ContentTagStart, + __ast_path: &mut AstKindPath, + ) -> ContentTagStart { + if self.enabled { + ::fold_content_tag_start(&mut self.visitor, node, __ast_path) + } else { + node + } + } + #[inline] fn fold_continue_stmt( &mut self, @@ -123939,6 +126219,17 @@ impl FoldWithAstPath for ClassMember { ); ClassMember::AutoAccessor { 0: _field_0 } } + ClassMember::ContentTagMember { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassMember( + self::fields::ClassMemberField::ContentTagMember, + )); + let _field_0 = >::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + ClassMember::ContentTagMember { 0: _field_0 } + } } } } @@ -124322,6 +126613,230 @@ impl FoldWithAstPath for Constructor { } #[cfg(any(docsrs, feature = "path"))] #[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ContentTagContent { + #[doc = "Calls [FoldAstPath`::fold_content_tag_content`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_content_tag_content(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ContentTagContent { span, value } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagContent( + self::fields::ContentTagContentField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let value = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagContent( + self::fields::ContentTagContentField::Value, + )); + >::fold_with_ast_path( + value, + visitor, + &mut *__ast_path, + ) + }; + ContentTagContent { span, value } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ContentTagEnd { + #[doc = "Calls [FoldAstPath`::fold_content_tag_end`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_content_tag_end(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ContentTagEnd { span } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagEnd( + self::fields::ContentTagEndField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + ContentTagEnd { span } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ContentTagExpression { + #[doc = "Calls [FoldAstPath`::fold_content_tag_expression`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_content_tag_expression(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ContentTagExpression { + span, + opening, + contents, + closing, + } => { + let span = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let opening = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Opening, + )); + as FoldWithAstPath>::fold_with_ast_path( + opening, + visitor, + &mut *__ast_path, + ) + }; + let contents = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Contents, + )); + as FoldWithAstPath>::fold_with_ast_path( + contents, + visitor, + &mut *__ast_path, + ) + }; + let closing = { + let mut __ast_path = + __ast_path.with_guard(AstParentKind::ContentTagExpression( + self::fields::ContentTagExpressionField::Closing, + )); + as FoldWithAstPath>::fold_with_ast_path( + closing, + visitor, + &mut *__ast_path, + ) + }; + ContentTagExpression { + span, + opening, + contents, + closing, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ContentTagMember { + #[doc = "Calls [FoldAstPath`::fold_content_tag_member`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_content_tag_member(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ContentTagMember { + span, + opening, + contents, + closing, + } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + let opening = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Opening, + )); + as FoldWithAstPath>::fold_with_ast_path( + opening, + visitor, + &mut *__ast_path, + ) + }; + let contents = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Contents, + )); + as FoldWithAstPath>::fold_with_ast_path( + contents, + visitor, + &mut *__ast_path, + ) + }; + let closing = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagMember( + self::fields::ContentTagMemberField::Closing, + )); + as FoldWithAstPath>::fold_with_ast_path( + closing, + visitor, + &mut *__ast_path, + ) + }; + ContentTagMember { + span, + opening, + contents, + closing, + } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] +impl FoldWithAstPath for ContentTagStart { + #[doc = "Calls [FoldAstPath`::fold_content_tag_start`] with `self`."] + fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + ::fold_content_tag_start(visitor, self, __ast_path) + } + + fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { + match self { + ContentTagStart { span } => { + let span = { + let mut __ast_path = __ast_path.with_guard(AstParentKind::ContentTagStart( + self::fields::ContentTagStartField::Span, + )); + >::fold_with_ast_path( + span, + visitor, + &mut *__ast_path, + ) + }; + ContentTagStart { span } + } + } + } +} +#[cfg(any(docsrs, feature = "path"))] +#[cfg_attr(docsrs, doc(cfg(feature = "path")))] impl FoldWithAstPath for ContinueStmt { #[doc = "Calls [FoldAstPath`::fold_continue_stmt`] with `self`."] fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self { @@ -125258,6 +127773,17 @@ impl FoldWithAstPath for Expr { ); Expr::JSXFragment { 0: _field_0 } } + Expr::ContentTagExpression { 0: _field_0 } => { + let mut __ast_path = __ast_path.with_guard(AstParentKind::Expr( + self::fields::ExprField::ContentTagExpression, + )); + let _field_0 = >::fold_with_ast_path( + _field_0, + visitor, + &mut *__ast_path, + ); + Expr::ContentTagExpression { 0: _field_0 } + } Expr::TsTypeAssertion { 0: _field_0 } => { let mut __ast_path = __ast_path.with_guard(AstParentKind::Expr( self::fields::ExprField::TsTypeAssertion, @@ -136238,6 +138764,8 @@ pub mod fields { StaticBlock, #[doc = "Represents [`ClassMember::AutoAccessor`]"] AutoAccessor, + #[doc = "Represents [`ClassMember::ContentTagMember`]"] + ContentTagMember, } impl ClassMethodField { pub(crate) fn set_index(&mut self, index: usize) { @@ -136367,6 +138895,80 @@ pub mod fields { #[doc = "Represents [`Constructor::is_optional`]"] IsOptional, } + impl ContentTagContentField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub enum ContentTagContentField { + #[doc = "Represents [`ContentTagContent::span`]"] + Span, + #[doc = "Represents [`ContentTagContent::value`]"] + Value, + } + impl ContentTagEndField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub enum ContentTagEndField { + #[doc = "Represents [`ContentTagEnd::span`]"] + Span, + } + impl ContentTagExpressionField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub enum ContentTagExpressionField { + #[doc = "Represents [`ContentTagExpression::span`]"] + Span, + #[doc = "Represents [`ContentTagExpression::opening`]"] + Opening, + #[doc = "Represents [`ContentTagExpression::contents`]"] + Contents, + #[doc = "Represents [`ContentTagExpression::closing`]"] + Closing, + } + impl ContentTagMemberField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub enum ContentTagMemberField { + #[doc = "Represents [`ContentTagMember::span`]"] + Span, + #[doc = "Represents [`ContentTagMember::opening`]"] + Opening, + #[doc = "Represents [`ContentTagMember::contents`]"] + Contents, + #[doc = "Represents [`ContentTagMember::closing`]"] + Closing, + } + impl ContentTagStartField { + pub(crate) fn set_index(&mut self, index: usize) { + match self { + _ => swc_visit::wrong_ast_path(), + } + } + } + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + pub enum ContentTagStartField { + #[doc = "Represents [`ContentTagStart::span`]"] + Span, + } impl ContinueStmtField { pub(crate) fn set_index(&mut self, index: usize) { match self { @@ -136660,6 +139262,8 @@ pub mod fields { Jsxelement, #[doc = "Represents [`Expr::JSXFragment`]"] Jsxfragment, + #[doc = "Represents [`Expr::ContentTagExpression`]"] + ContentTagExpression, #[doc = "Represents [`Expr::TsTypeAssertion`]"] TsTypeAssertion, #[doc = "Represents [`Expr::TsConstAssertion`]"] @@ -140002,6 +142606,11 @@ pub mod fields { ComputedPropName(ComputedPropNameField), CondExpr(CondExprField), Constructor(ConstructorField), + ContentTagContent(ContentTagContentField), + ContentTagEnd(ContentTagEndField), + ContentTagExpression(ContentTagExpressionField), + ContentTagMember(ContentTagMemberField), + ContentTagStart(ContentTagStartField), ContinueStmt(ContinueStmtField), DebuggerStmt(DebuggerStmtField), Decl(DeclField), @@ -140242,6 +142851,11 @@ pub mod fields { Self::ComputedPropName(v) => v.set_index(index), Self::CondExpr(v) => v.set_index(index), Self::Constructor(v) => v.set_index(index), + Self::ContentTagContent(v) => v.set_index(index), + Self::ContentTagEnd(v) => v.set_index(index), + Self::ContentTagExpression(v) => v.set_index(index), + Self::ContentTagMember(v) => v.set_index(index), + Self::ContentTagStart(v) => v.set_index(index), Self::ContinueStmt(v) => v.set_index(index), Self::DebuggerStmt(v) => v.set_index(index), Self::Decl(v) => v.set_index(index), @@ -140482,6 +143096,11 @@ pub mod fields { ComputedPropName(&'ast ComputedPropName, ComputedPropNameField), CondExpr(&'ast CondExpr, CondExprField), Constructor(&'ast Constructor, ConstructorField), + ContentTagContent(&'ast ContentTagContent, ContentTagContentField), + ContentTagEnd(&'ast ContentTagEnd, ContentTagEndField), + ContentTagExpression(&'ast ContentTagExpression, ContentTagExpressionField), + ContentTagMember(&'ast ContentTagMember, ContentTagMemberField), + ContentTagStart(&'ast ContentTagStart, ContentTagStartField), ContinueStmt(&'ast ContinueStmt, ContinueStmtField), DebuggerStmt(&'ast DebuggerStmt, DebuggerStmtField), Decl(&'ast Decl, DeclField), @@ -140740,6 +143359,11 @@ pub mod fields { Self::ComputedPropName(_, __field_kind) => __field_kind.set_index(index), Self::CondExpr(_, __field_kind) => __field_kind.set_index(index), Self::Constructor(_, __field_kind) => __field_kind.set_index(index), + Self::ContentTagContent(_, __field_kind) => __field_kind.set_index(index), + Self::ContentTagEnd(_, __field_kind) => __field_kind.set_index(index), + Self::ContentTagExpression(_, __field_kind) => __field_kind.set_index(index), + Self::ContentTagMember(_, __field_kind) => __field_kind.set_index(index), + Self::ContentTagStart(_, __field_kind) => __field_kind.set_index(index), Self::ContinueStmt(_, __field_kind) => __field_kind.set_index(index), Self::DebuggerStmt(_, __field_kind) => __field_kind.set_index(index), Self::Decl(_, __field_kind) => __field_kind.set_index(index), @@ -140989,6 +143613,19 @@ pub mod fields { } Self::CondExpr(_, __field_kind) => AstParentKind::CondExpr(*__field_kind), Self::Constructor(_, __field_kind) => AstParentKind::Constructor(*__field_kind), + Self::ContentTagContent(_, __field_kind) => { + AstParentKind::ContentTagContent(*__field_kind) + } + Self::ContentTagEnd(_, __field_kind) => AstParentKind::ContentTagEnd(*__field_kind), + Self::ContentTagExpression(_, __field_kind) => { + AstParentKind::ContentTagExpression(*__field_kind) + } + Self::ContentTagMember(_, __field_kind) => { + AstParentKind::ContentTagMember(*__field_kind) + } + Self::ContentTagStart(_, __field_kind) => { + AstParentKind::ContentTagStart(*__field_kind) + } Self::ContinueStmt(_, __field_kind) => AstParentKind::ContinueStmt(*__field_kind), Self::DebuggerStmt(_, __field_kind) => AstParentKind::DebuggerStmt(*__field_kind), Self::Decl(_, __field_kind) => AstParentKind::Decl(*__field_kind), @@ -141492,6 +144129,31 @@ impl<'ast> From<&'ast Constructor> for NodeRef<'ast> { NodeRef::Constructor(node) } } +impl<'ast> From<&'ast ContentTagContent> for NodeRef<'ast> { + fn from(node: &'ast ContentTagContent) -> Self { + NodeRef::ContentTagContent(node) + } +} +impl<'ast> From<&'ast ContentTagEnd> for NodeRef<'ast> { + fn from(node: &'ast ContentTagEnd) -> Self { + NodeRef::ContentTagEnd(node) + } +} +impl<'ast> From<&'ast ContentTagExpression> for NodeRef<'ast> { + fn from(node: &'ast ContentTagExpression) -> Self { + NodeRef::ContentTagExpression(node) + } +} +impl<'ast> From<&'ast ContentTagMember> for NodeRef<'ast> { + fn from(node: &'ast ContentTagMember) -> Self { + NodeRef::ContentTagMember(node) + } +} +impl<'ast> From<&'ast ContentTagStart> for NodeRef<'ast> { + fn from(node: &'ast ContentTagStart) -> Self { + NodeRef::ContentTagStart(node) + } +} impl<'ast> From<&'ast ContinueStmt> for NodeRef<'ast> { fn from(node: &'ast ContinueStmt) -> Self { NodeRef::ContinueStmt(node) @@ -142537,6 +145199,11 @@ pub enum NodeRef<'ast> { ComputedPropName(&'ast ComputedPropName), CondExpr(&'ast CondExpr), Constructor(&'ast Constructor), + ContentTagContent(&'ast ContentTagContent), + ContentTagEnd(&'ast ContentTagEnd), + ContentTagExpression(&'ast ContentTagExpression), + ContentTagMember(&'ast ContentTagMember), + ContentTagStart(&'ast ContentTagStart), ContinueStmt(&'ast ContinueStmt), DebuggerStmt(&'ast DebuggerStmt), Decl(&'ast Decl), @@ -143036,6 +145703,9 @@ impl<'ast> NodeRef<'ast> { ClassMember::AutoAccessor(v0) => { Box::new(::std::iter::once(NodeRef::AutoAccessor(v0))) } + ClassMember::ContentTagMember(v0) => { + Box::new(::std::iter::once(NodeRef::ContentTagMember(v0))) + } _ => Box::new(::std::iter::empty::>()), }, NodeRef::ClassMethod(node) => { @@ -143119,6 +145789,50 @@ impl<'ast> NodeRef<'ast> { ); Box::new(iterator) } + NodeRef::ContentTagContent(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + NodeRef::ContentTagEnd(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } + NodeRef::ContentTagExpression(node) => { + let iterator = ::std::iter::empty::>() + .chain({ + let item = &*node.opening; + ::std::iter::once(NodeRef::ContentTagStart(&item)) + }) + .chain({ + let item = &*node.contents; + ::std::iter::once(NodeRef::ContentTagContent(&item)) + }) + .chain({ + let item = &*node.closing; + ::std::iter::once(NodeRef::ContentTagEnd(&item)) + }); + Box::new(iterator) + } + NodeRef::ContentTagMember(node) => { + let iterator = ::std::iter::empty::>() + .chain({ + let item = &*node.opening; + ::std::iter::once(NodeRef::ContentTagStart(&item)) + }) + .chain({ + let item = &*node.contents; + ::std::iter::once(NodeRef::ContentTagContent(&item)) + }) + .chain({ + let item = &*node.closing; + ::std::iter::once(NodeRef::ContentTagEnd(&item)) + }); + Box::new(iterator) + } + NodeRef::ContentTagStart(node) => { + let iterator = ::std::iter::empty::>(); + Box::new(iterator) + } NodeRef::ContinueStmt(node) => { let iterator = ::std::iter::empty::>().chain( node.label @@ -143266,6 +145980,9 @@ impl<'ast> NodeRef<'ast> { Expr::JSXEmpty(v0) => Box::new(::std::iter::once(NodeRef::JSXEmptyExpr(v0))), Expr::JSXElement(v0) => Box::new(::std::iter::once(NodeRef::JSXElement(v0))), Expr::JSXFragment(v0) => Box::new(::std::iter::once(NodeRef::JSXFragment(v0))), + Expr::ContentTagExpression(v0) => { + Box::new(::std::iter::once(NodeRef::ContentTagExpression(v0))) + } Expr::TsTypeAssertion(v0) => { Box::new(::std::iter::once(NodeRef::TsTypeAssertion(v0))) } diff --git a/crates/swc_ecma_visit/src/lib.rs b/crates/swc_ecma_visit/src/lib.rs index 3f5a3f198ac2..87d9d463dea7 100644 --- a/crates/swc_ecma_visit/src/lib.rs +++ b/crates/swc_ecma_visit/src/lib.rs @@ -980,1395 +980,6 @@ macro_rules! noop_visit_mut_type { }; } -define!({ - use BigIntValue; - - pub struct Class { - pub span: Span, - pub decorators: Vec, - pub body: Vec, - pub super_class: Option>, - pub is_abstract: bool, - pub type_params: Option>, - pub super_type_params: Option>, - pub implements: Vec, - } - - pub enum ClassMember { - Constructor(Constructor), - Method(ClassMethod), - PrivateMethod(PrivateMethod), - ClassProp(ClassProp), - PrivateProp(PrivateProp), - TsIndexSignature(TsIndexSignature), - Empty(EmptyStmt), - StaticBlock(StaticBlock), - AutoAccessor(AutoAccessor), - ContentTagMember(ContentTagMember), - } - - pub struct ClassProp { - pub span: Span, - pub key: PropName, - pub value: Option>, - pub type_ann: Option>, - pub is_static: bool, - pub decorators: Vec, - pub accessibility: Option, - pub is_abstract: bool, - pub is_optional: bool, - pub is_override: bool, - pub readonly: bool, - pub declare: bool, - pub definite: bool, - } - pub struct PrivateProp { - pub span: Span, - pub key: PrivateName, - pub value: Option>, - pub type_ann: Option>, - pub is_static: bool, - pub decorators: Vec, - pub accessibility: Option, - pub is_optional: bool, - pub is_override: bool, - pub readonly: bool, - pub definite: bool, - } - pub struct ClassMethod { - pub span: Span, - pub key: PropName, - pub function: Box, - pub kind: MethodKind, - pub is_static: bool, - pub accessibility: Option, - pub is_abstract: bool, - pub is_optional: bool, - pub is_override: bool, - } - pub struct PrivateMethod { - pub span: Span, - pub key: PrivateName, - pub function: Box, - pub kind: MethodKind, - pub is_static: bool, - pub accessibility: Option, - pub is_abstract: bool, - pub is_optional: bool, - pub is_override: bool, - } - pub struct Constructor { - pub span: Span, - pub key: PropName, - pub params: Vec, - pub body: Option, - pub accessibility: Option, - pub is_optional: bool, - } - pub struct Decorator { - pub span: Span, - pub expr: Box, - } - pub struct StaticBlock { - pub span: Span, - pub body: BlockStmt, - } - pub enum MethodKind { - Method, - Getter, - Setter, - } - pub enum Decl { - Class(ClassDecl), - Fn(FnDecl), - Var(Box), - Using(Box), - TsInterface(Box), - TsTypeAlias(Box), - TsEnum(Box), - TsModule(Box), - } - pub struct FnDecl { - pub ident: Ident, - pub declare: bool, - pub function: Box, - } - pub struct ClassDecl { - pub ident: Ident, - pub declare: bool, - pub class: Box, - } - pub struct VarDecl { - pub span: Span, - pub kind: VarDeclKind, - pub declare: bool, - pub decls: Vec, - } - pub enum VarDeclKind { - Var, - Let, - Const, - } - pub struct VarDeclarator { - pub span: Span, - pub name: Pat, - pub init: Option>, - pub definite: bool, - } - pub enum Expr { - This(ThisExpr), - Array(ArrayLit), - Object(ObjectLit), - Fn(FnExpr), - Unary(UnaryExpr), - Update(UpdateExpr), - Bin(BinExpr), - Assign(AssignExpr), - Member(MemberExpr), - SuperProp(SuperPropExpr), - Cond(CondExpr), - Call(CallExpr), - New(NewExpr), - Seq(SeqExpr), - Ident(Ident), - Lit(Lit), - Tpl(Tpl), - TaggedTpl(TaggedTpl), - Arrow(ArrowExpr), - Class(ClassExpr), - Yield(YieldExpr), - MetaProp(MetaPropExpr), - Await(AwaitExpr), - Paren(ParenExpr), - JSXMember(JSXMemberExpr), - JSXNamespacedName(JSXNamespacedName), - JSXEmpty(JSXEmptyExpr), - JSXElement(Box), - JSXFragment(JSXFragment), - TsTypeAssertion(TsTypeAssertion), - TsConstAssertion(TsConstAssertion), - TsNonNull(TsNonNullExpr), - TsAs(TsAsExpr), - TsSatisfies(TsSatisfiesExpr), - TsInstantiation(TsInstantiation), - PrivateName(PrivateName), - OptChain(OptChainExpr), - Invalid(Invalid), - ContentTagExpression(ContentTagExpression), - } - pub struct ThisExpr { - pub span: Span, - } - pub struct ArrayLit { - pub span: Span, - pub elems: Vec>, - } - pub struct ObjectLit { - pub span: Span, - pub props: Vec, - } - pub enum PropOrSpread { - Spread(SpreadElement), - Prop(Box), - } - pub struct SpreadElement { - pub dot3_token: Span, - pub expr: Box, - } - pub struct UnaryExpr { - pub span: Span, - pub op: UnaryOp, - pub arg: Box, - } - pub struct UpdateExpr { - pub span: Span, - pub op: UpdateOp, - pub prefix: bool, - pub arg: Box, - } - pub struct BinExpr { - pub span: Span, - pub op: BinaryOp, - pub left: Box, - pub right: Box, - } - pub struct FnExpr { - pub ident: Option, - pub function: Box, - } - pub struct ClassExpr { - pub ident: Option, - pub class: Box, - } - pub struct AssignExpr { - pub span: Span, - pub op: AssignOp, - pub left: AssignTarget, - pub right: Box, - } - pub struct MemberExpr { - pub span: Span, - pub obj: Box, - pub prop: MemberProp, - } - pub enum MemberProp { - Ident(Ident), - PrivateName(PrivateName), - Computed(ComputedPropName), - } - pub struct SuperPropExpr { - pub span: Span, - pub obj: Super, - pub prop: SuperProp, - } - pub enum SuperProp { - Ident(Ident), - Computed(ComputedPropName), - } - pub struct CondExpr { - pub span: Span, - pub test: Box, - pub cons: Box, - pub alt: Box, - } - pub struct CallExpr { - pub span: Span, - pub callee: Callee, - pub args: Vec, - pub type_args: Option>, - } - pub struct NewExpr { - pub span: Span, - pub callee: Box, - pub args: Option>, - pub type_args: Option>, - } - pub struct SeqExpr { - pub span: Span, - pub exprs: Vec>, - } - pub struct ArrowExpr { - pub span: Span, - pub params: Vec, - pub body: Box, - pub is_async: bool, - pub is_generator: bool, - pub type_params: Option>, - pub return_type: Option>, - } - pub struct YieldExpr { - pub span: Span, - pub arg: Option>, - pub delegate: bool, - } - pub struct MetaPropExpr { - pub span: Span, - pub kind: MetaPropKind, - } - pub enum MetaPropKind { - NewTarget, - ImportMeta, - } - pub struct AwaitExpr { - pub span: Span, - pub arg: Box, - } - pub struct Tpl { - pub span: Span, - pub exprs: Vec>, - pub quasis: Vec, - } - pub struct TaggedTpl { - pub span: Span, - pub tag: Box, - pub type_params: Option>, - pub tpl: Box, - } - pub struct TplElement { - pub span: Span, - pub tail: bool, - pub cooked: Option, - pub raw: Atom, - } - pub struct ParenExpr { - pub span: Span, - pub expr: Box, - } - pub enum Callee { - Super(Super), - Import(Import), - Expr(Box), - } - pub struct Super { - pub span: Span, - } - pub struct Import { - pub span: Span, - pub phase: ImportPhase, - } - pub struct ExprOrSpread { - pub spread: Option, - pub expr: Box, - } - pub enum BlockStmtOrExpr { - BlockStmt(BlockStmt), - Expr(Box), - } - - pub enum AssignTarget { - Simple(SimpleAssignTarget), - Pat(AssignTargetPat), - } - - pub enum AssignTargetPat { - Array(ArrayPat), - Object(ObjectPat), - Invalid(Invalid), - } - - pub enum SimpleAssignTarget { - Ident(BindingIdent), - Member(MemberExpr), - SuperProp(SuperPropExpr), - OptChain(OptChainExpr), - Paren(ParenExpr), - TsAs(TsAsExpr), - TsSatisfies(TsSatisfiesExpr), - TsNonNull(TsNonNullExpr), - TsTypeAssertion(TsTypeAssertion), - TsInstantiation(TsInstantiation), - Invalid(Invalid), - } - - pub struct OptChainExpr { - pub span: Span, - pub optional: bool, - pub base: Box, - } - pub enum OptChainBase { - Member(MemberExpr), - Call(OptCall), - } - pub struct OptCall { - pub span: Span, - pub callee: Box, - pub args: Vec, - pub type_args: Option>, - } - pub struct Function { - pub params: Vec, - pub decorators: Vec, - pub span: Span, - pub body: Option, - pub is_generator: bool, - pub is_async: bool, - pub type_params: Option>, - pub return_type: Option>, - } - pub struct Param { - pub span: Span, - pub decorators: Vec, - pub pat: Pat, - } - pub enum ParamOrTsParamProp { - TsParamProp(TsParamProp), - Param(Param), - } - - pub struct BindingIdent { - pub id: Ident, - pub type_ann: Option>, - } - - pub struct Ident { - pub span: Span, - pub sym: Atom, - pub optional: bool, - } - - pub struct PrivateName { - pub span: Span, - pub id: Ident, - } - - pub enum JSXObject { - JSXMemberExpr(Box), - Ident(Ident), - } - pub struct JSXMemberExpr { - pub obj: JSXObject, - pub prop: Ident, - } - pub struct JSXNamespacedName { - pub ns: Ident, - pub name: Ident, - } - pub struct JSXEmptyExpr { - pub span: Span, - } - pub struct JSXExprContainer { - pub span: Span, - pub expr: JSXExpr, - } - pub enum JSXExpr { - JSXEmptyExpr(JSXEmptyExpr), - Expr(Box), - } - pub struct JSXSpreadChild { - pub span: Span, - pub expr: Box, - } - pub enum JSXElementName { - Ident(Ident), - JSXMemberExpr(JSXMemberExpr), - JSXNamespacedName(JSXNamespacedName), - } - pub struct JSXOpeningElement { - pub name: JSXElementName, - pub span: Span, - pub attrs: Vec, - pub self_closing: bool, - pub type_args: Option>, - } - pub enum JSXAttrOrSpread { - JSXAttr(JSXAttr), - SpreadElement(SpreadElement), - } - pub struct JSXClosingElement { - pub span: Span, - pub name: JSXElementName, - } - pub struct JSXAttr { - pub span: Span, - pub name: JSXAttrName, - pub value: Option, - } - pub enum JSXAttrName { - Ident(Ident), - JSXNamespacedName(JSXNamespacedName), - } - pub enum JSXAttrValue { - Lit(Lit), - JSXExprContainer(JSXExprContainer), - JSXElement(Box), - JSXFragment(JSXFragment), - } - pub struct JSXText { - pub span: Span, - pub value: Atom, - pub raw: Atom, - } - pub struct JSXElement { - pub span: Span, - pub opening: JSXOpeningElement, - pub children: Vec, - pub closing: Option, - } - pub enum JSXElementChild { - JSXText(JSXText), - JSXExprContainer(JSXExprContainer), - JSXSpreadChild(JSXSpreadChild), - JSXElement(Box), - JSXFragment(JSXFragment), - } - pub struct JSXFragment { - pub span: Span, - pub opening: JSXOpeningFragment, - pub children: Vec, - pub closing: JSXClosingFragment, - } - pub struct JSXOpeningFragment { - pub span: Span, - } - pub struct JSXClosingFragment { - pub span: Span, - } - pub struct Invalid { - pub span: Span, - } - pub enum Lit { - Str(Str), - Bool(Bool), - Null(Null), - Num(Number), - BigInt(BigInt), - Regex(Regex), - JSXText(JSXText), - } - pub struct BigInt { - pub span: Span, - pub value: Box, - pub raw: Option, - } - pub struct Str { - pub span: Span, - pub value: Atom, - pub raw: Option, - } - pub struct Bool { - pub span: Span, - pub value: bool, - } - pub struct Null { - pub span: Span, - } - pub struct Regex { - pub span: Span, - pub exp: Atom, - pub flags: Atom, - } - pub struct Number { - pub span: Span, - pub value: f64, - pub raw: Option, - } - pub enum Program { - Module(Module), - Script(Script), - // TODO: reenable once experimental_metadata breaking change is merged - // ReservedUnused(ReservedUnused), - } - pub struct Module { - pub span: Span, - pub body: Vec, - pub shebang: Option, - } - pub struct Script { - pub span: Span, - pub body: Vec, - pub shebang: Option, - } - pub enum ModuleItem { - ModuleDecl(ModuleDecl), - Stmt(Stmt), - } - pub enum ModuleDecl { - Import(ImportDecl), - ExportDecl(ExportDecl), - ExportNamed(NamedExport), - ExportDefaultDecl(ExportDefaultDecl), - ExportDefaultExpr(ExportDefaultExpr), - ExportAll(ExportAll), - TsImportEquals(Box), - TsExportAssignment(TsExportAssignment), - TsNamespaceExport(TsNamespaceExportDecl), - } - pub struct ExportDefaultExpr { - pub span: Span, - pub expr: Box, - } - pub struct ExportDecl { - pub span: Span, - pub decl: Decl, - } - pub struct ImportDecl { - pub span: Span, - pub specifiers: Vec, - pub src: Box, - pub type_only: bool, - pub with: Option>, - pub phase: ImportPhase, - } - pub struct ExportAll { - pub span: Span, - pub src: Box, - pub type_only: bool, - pub with: Option>, - } - pub struct NamedExport { - pub span: Span, - pub specifiers: Vec, - pub src: Option>, - pub type_only: bool, - pub with: Option>, - } - pub struct ExportDefaultDecl { - pub span: Span, - pub decl: DefaultDecl, - } - pub enum DefaultDecl { - Class(ClassExpr), - Fn(FnExpr), - TsInterfaceDecl(Box), - } - pub enum ImportSpecifier { - Named(ImportNamedSpecifier), - Default(ImportDefaultSpecifier), - Namespace(ImportStarAsSpecifier), - } - pub struct ImportDefaultSpecifier { - pub span: Span, - pub local: Ident, - } - pub struct ImportStarAsSpecifier { - pub span: Span, - pub local: Ident, - } - pub struct ImportNamedSpecifier { - pub span: Span, - pub local: Ident, - pub imported: Option, - pub is_type_only: bool, - } - pub enum ExportSpecifier { - Namespace(ExportNamespaceSpecifier), - Default(ExportDefaultSpecifier), - Named(ExportNamedSpecifier), - } - pub struct ExportNamespaceSpecifier { - pub span: Span, - pub name: ModuleExportName, - } - pub struct ExportDefaultSpecifier { - pub exported: Ident, - } - pub enum ModuleExportName { - Ident(Ident), - Str(Str), - } - pub struct ExportNamedSpecifier { - pub span: Span, - pub orig: ModuleExportName, - pub exported: Option, - pub is_type_only: bool, - } - pub enum BinaryOp { - EqEq, - NotEq, - EqEqEq, - NotEqEq, - Lt, - LtEq, - Gt, - GtEq, - LShift, - RShift, - ZeroFillRShift, - Add, - Sub, - Mul, - Div, - Mod, - BitOr, - BitXor, - BitAnd, - LogicalOr, - LogicalAnd, - In, - InstanceOf, - Exp, - NullishCoalescing, - } - pub enum AssignOp { - Assign, - AddAssign, - SubAssign, - MulAssign, - DivAssign, - ModAssign, - LShiftAssign, - RShiftAssign, - ZeroFillRShiftAssign, - BitOrAssign, - BitXorAssign, - BitAndAssign, - ExpAssign, - AndAssign, - OrAssign, - NullishAssign, - } - - pub enum UpdateOp { - PlusPlus, - MinusMinus, - } - pub enum UnaryOp { - Minus, - Plus, - Bang, - Tilde, - TypeOf, - Void, - Delete, - } - pub enum Pat { - Ident(BindingIdent), - Array(ArrayPat), - Rest(RestPat), - Object(ObjectPat), - Assign(AssignPat), - Invalid(Invalid), - Expr(Box), - } - pub struct ArrayPat { - pub span: Span, - pub elems: Vec>, - pub optional: bool, - pub type_ann: Option>, - } - pub struct ObjectPat { - pub span: Span, - pub props: Vec, - pub optional: bool, - pub type_ann: Option>, - } - pub struct AssignPat { - pub span: Span, - pub left: Box, - pub right: Box, - } - pub struct RestPat { - pub span: Span, - pub dot3_token: Span, - pub arg: Box, - pub type_ann: Option>, - } - pub enum ObjectPatProp { - KeyValue(KeyValuePatProp), - Assign(AssignPatProp), - Rest(RestPat), - } - pub struct KeyValuePatProp { - pub key: PropName, - pub value: Box, - } - pub struct AssignPatProp { - pub span: Span, - pub key: BindingIdent, - pub value: Option>, - } - pub enum Prop { - Shorthand(Ident), - KeyValue(KeyValueProp), - Assign(AssignProp), - Getter(GetterProp), - Setter(SetterProp), - Method(MethodProp), - } - pub struct KeyValueProp { - pub key: PropName, - pub value: Box, - } - pub struct AssignProp { - pub key: Ident, - pub value: Box, - } - pub struct GetterProp { - pub span: Span, - pub key: PropName, - pub type_ann: Option>, - pub body: Option, - } - pub struct SetterProp { - pub span: Span, - pub key: PropName, - pub this_param: Option, - pub param: Box, - pub body: Option, - } - pub struct MethodProp { - pub key: PropName, - pub function: Box, - } - pub enum PropName { - Ident(Ident), - Str(Str), - Num(Number), - BigInt(BigInt), - Computed(ComputedPropName), - } - pub struct ComputedPropName { - pub span: Span, - pub expr: Box, - } - pub struct BlockStmt { - pub span: Span, - pub stmts: Vec, - } - pub enum Stmt { - Block(BlockStmt), - Empty(EmptyStmt), - Debugger(DebuggerStmt), - With(WithStmt), - Return(ReturnStmt), - Labeled(LabeledStmt), - Break(BreakStmt), - Continue(ContinueStmt), - If(IfStmt), - Switch(SwitchStmt), - Throw(ThrowStmt), - Try(Box), - While(WhileStmt), - DoWhile(DoWhileStmt), - For(ForStmt), - ForIn(ForInStmt), - ForOf(ForOfStmt), - Decl(Decl), - Expr(ExprStmt), - } - pub struct ExprStmt { - pub span: Span, - pub expr: Box, - } - pub struct EmptyStmt { - pub span: Span, - } - pub struct DebuggerStmt { - pub span: Span, - } - pub struct WithStmt { - pub span: Span, - pub obj: Box, - pub body: Box, - } - pub struct ReturnStmt { - pub span: Span, - pub arg: Option>, - } - pub struct LabeledStmt { - pub span: Span, - pub label: Ident, - pub body: Box, - } - pub struct BreakStmt { - pub span: Span, - pub label: Option, - } - pub struct ContinueStmt { - pub span: Span, - pub label: Option, - } - pub struct IfStmt { - pub span: Span, - pub test: Box, - pub cons: Box, - pub alt: Option>, - } - pub struct SwitchStmt { - pub span: Span, - pub discriminant: Box, - pub cases: Vec, - } - pub struct ThrowStmt { - pub span: Span, - pub arg: Box, - } - pub struct TryStmt { - pub span: Span, - pub block: BlockStmt, - pub handler: Option, - pub finalizer: Option, - } - pub struct WhileStmt { - pub span: Span, - pub test: Box, - pub body: Box, - } - pub struct DoWhileStmt { - pub span: Span, - pub test: Box, - pub body: Box, - } - pub struct ForStmt { - pub span: Span, - pub init: Option, - pub test: Option>, - pub update: Option>, - pub body: Box, - } - pub struct ForInStmt { - pub span: Span, - pub left: ForHead, - pub right: Box, - pub body: Box, - } - pub struct ForOfStmt { - pub span: Span, - pub is_await: bool, - pub left: ForHead, - pub right: Box, - pub body: Box, - } - pub struct SwitchCase { - pub span: Span, - pub test: Option>, - pub cons: Vec, - } - pub struct CatchClause { - pub span: Span, - pub param: Option, - pub body: BlockStmt, - } - pub enum ForHead { - VarDecl(Box), - UsingDecl(Box), - Pat(Box), - } - pub enum VarDeclOrExpr { - VarDecl(Box), - Expr(Box), - } - pub struct TsTypeAnn { - pub span: Span, - pub type_ann: Box, - } - pub struct TsTypeParamDecl { - pub span: Span, - pub params: Vec, - } - pub struct TsTypeParam { - pub span: Span, - pub name: Ident, - pub is_in: bool, - pub is_out: bool, - pub is_const: bool, - pub constraint: Option>, - pub default: Option>, - } - pub struct TsTypeParamInstantiation { - pub span: Span, - pub params: Vec>, - } - pub struct TsParamProp { - pub span: Span, - pub decorators: Vec, - pub accessibility: Option, - pub is_override: bool, - pub readonly: bool, - pub param: TsParamPropParam, - } - pub enum TsParamPropParam { - Ident(BindingIdent), - Assign(AssignPat), - } - pub struct TsQualifiedName { - pub left: TsEntityName, - pub right: Ident, - } - pub enum TsEntityName { - TsQualifiedName(Box), - Ident(Ident), - } - pub enum TsTypeElement { - TsCallSignatureDecl(TsCallSignatureDecl), - TsConstructSignatureDecl(TsConstructSignatureDecl), - TsPropertySignature(TsPropertySignature), - TsGetterSignature(TsGetterSignature), - TsSetterSignature(TsSetterSignature), - TsMethodSignature(TsMethodSignature), - TsIndexSignature(TsIndexSignature), - } - pub struct TsCallSignatureDecl { - pub span: Span, - pub params: Vec, - pub type_ann: Option>, - pub type_params: Option>, - } - pub struct TsConstructSignatureDecl { - pub span: Span, - pub params: Vec, - pub type_ann: Option>, - pub type_params: Option>, - } - pub struct TsPropertySignature { - pub span: Span, - pub readonly: bool, - pub key: Box, - pub computed: bool, - pub optional: bool, - pub init: Option>, - pub params: Vec, - pub type_ann: Option>, - pub type_params: Option>, - } - - pub struct TsGetterSignature { - pub span: Span, - pub readonly: bool, - pub key: Box, - pub computed: bool, - pub optional: bool, - pub type_ann: Option>, - } - - pub struct TsSetterSignature { - pub span: Span, - pub readonly: bool, - pub key: Box, - pub computed: bool, - pub optional: bool, - pub param: TsFnParam, - } - pub struct TsMethodSignature { - pub span: Span, - pub readonly: bool, - pub key: Box, - pub computed: bool, - pub optional: bool, - pub params: Vec, - pub type_ann: Option>, - pub type_params: Option>, - } - pub struct TsIndexSignature { - pub params: Vec, - pub type_ann: Option>, - pub readonly: bool, - pub is_static: bool, - pub span: Span, - } - pub enum TsType { - TsKeywordType(TsKeywordType), - TsThisType(TsThisType), - TsFnOrConstructorType(TsFnOrConstructorType), - TsTypeRef(TsTypeRef), - TsTypeQuery(TsTypeQuery), - TsTypeLit(TsTypeLit), - TsArrayType(TsArrayType), - TsTupleType(TsTupleType), - TsOptionalType(TsOptionalType), - TsRestType(TsRestType), - TsUnionOrIntersectionType(TsUnionOrIntersectionType), - TsConditionalType(TsConditionalType), - TsInferType(TsInferType), - TsParenthesizedType(TsParenthesizedType), - TsTypeOperator(TsTypeOperator), - TsIndexedAccessType(TsIndexedAccessType), - TsMappedType(TsMappedType), - TsLitType(TsLitType), - TsTypePredicate(TsTypePredicate), - TsImportType(TsImportType), - } - pub enum TsFnOrConstructorType { - TsFnType(TsFnType), - TsConstructorType(TsConstructorType), - } - pub struct TsKeywordType { - pub span: Span, - pub kind: TsKeywordTypeKind, - } - pub enum TsKeywordTypeKind { - TsAnyKeyword, - TsUnknownKeyword, - TsNumberKeyword, - TsObjectKeyword, - TsBooleanKeyword, - TsBigIntKeyword, - TsStringKeyword, - TsSymbolKeyword, - TsVoidKeyword, - TsUndefinedKeyword, - TsNullKeyword, - TsNeverKeyword, - TsIntrinsicKeyword, - } - pub struct TsThisType { - pub span: Span, - } - pub enum TsFnParam { - Ident(BindingIdent), - Array(ArrayPat), - Rest(RestPat), - Object(ObjectPat), - } - pub struct TsFnType { - pub span: Span, - pub params: Vec, - pub type_params: Option>, - pub type_ann: Box, - } - pub struct TsConstructorType { - pub span: Span, - pub params: Vec, - pub type_params: Option>, - pub type_ann: Box, - pub is_abstract: bool, - } - pub struct TsTypeRef { - pub span: Span, - pub type_name: TsEntityName, - pub type_params: Option>, - } - pub struct TsTypePredicate { - pub span: Span, - pub asserts: bool, - pub param_name: TsThisTypeOrIdent, - pub type_ann: Option>, - } - pub enum TsThisTypeOrIdent { - TsThisType(TsThisType), - Ident(Ident), - } - pub struct TsTypeQuery { - pub span: Span, - pub expr_name: TsTypeQueryExpr, - pub type_args: Option>, - } - pub enum TsTypeQueryExpr { - TsEntityName(TsEntityName), - Import(TsImportType), - } - pub struct TsImportType { - pub span: Span, - pub arg: Str, - pub qualifier: Option, - pub type_args: Option>, - } - pub struct TsTypeLit { - pub span: Span, - pub members: Vec, - } - pub struct TsArrayType { - pub span: Span, - pub elem_type: Box, - } - - pub struct TsTupleType { - pub span: Span, - pub elem_types: Vec, - } - - pub struct TsTupleElement { - pub span: Span, - pub label: Option, - pub ty: Box, - } - - pub struct TsOptionalType { - pub span: Span, - pub type_ann: Box, - } - pub struct TsRestType { - pub span: Span, - pub type_ann: Box, - } - pub enum TsUnionOrIntersectionType { - TsUnionType(TsUnionType), - TsIntersectionType(TsIntersectionType), - } - pub struct TsUnionType { - pub span: Span, - pub types: Vec>, - } - pub struct TsIntersectionType { - pub span: Span, - pub types: Vec>, - } - pub struct TsConditionalType { - pub span: Span, - pub check_type: Box, - pub extends_type: Box, - pub true_type: Box, - pub false_type: Box, - } - pub struct TsInferType { - pub span: Span, - pub type_param: TsTypeParam, - } - pub struct TsParenthesizedType { - pub span: Span, - pub type_ann: Box, - } - pub struct TsTypeOperator { - pub span: Span, - pub op: TsTypeOperatorOp, - pub type_ann: Box, - } - pub enum TsTypeOperatorOp { - KeyOf, - Unique, - ReadOnly, - } - pub struct TsIndexedAccessType { - pub span: Span, - pub readonly: bool, - pub obj_type: Box, - pub index_type: Box, - } - pub enum TruePlusMinus { - True, - Plus, - Minus, - } - pub struct TsMappedType { - pub span: Span, - pub readonly: Option, - pub type_param: TsTypeParam, - pub name_type: Option>, - pub optional: Option, - pub type_ann: Option>, - } - pub struct TsLitType { - pub span: Span, - pub lit: TsLit, - } - pub enum TsLit { - BigInt(BigInt), - Number(Number), - Str(Str), - Bool(Bool), - Tpl(TsTplLitType), - } - pub struct TsTplLitType { - pub span: Span, - pub types: Vec>, - pub quasis: Vec, - } - pub struct TsInterfaceDecl { - pub span: Span, - pub id: Ident, - pub declare: bool, - pub type_params: Option>, - pub extends: Vec, - pub body: TsInterfaceBody, - } - pub struct TsInterfaceBody { - pub span: Span, - pub body: Vec, - } - pub struct TsExprWithTypeArgs { - pub span: Span, - pub expr: Box, - pub type_args: Option>, - } - pub struct TsTypeAliasDecl { - pub span: Span, - pub declare: bool, - pub id: Ident, - pub type_params: Option>, - pub type_ann: Box, - } - pub struct TsEnumDecl { - pub span: Span, - pub declare: bool, - pub is_const: bool, - pub id: Ident, - pub members: Vec, - } - pub struct TsEnumMember { - pub span: Span, - pub id: TsEnumMemberId, - pub init: Option>, - } - pub enum TsEnumMemberId { - Ident(Ident), - Str(Str), - } - pub struct TsModuleDecl { - pub span: Span, - pub declare: bool, - pub global: bool, - pub id: TsModuleName, - pub body: Option, - } - pub enum TsNamespaceBody { - TsModuleBlock(TsModuleBlock), - TsNamespaceDecl(TsNamespaceDecl), - } - pub struct TsModuleBlock { - pub span: Span, - pub body: Vec, - } - pub struct TsNamespaceDecl { - pub span: Span, - pub declare: bool, - pub global: bool, - pub id: Ident, - pub body: Box, - } - pub enum TsModuleName { - Ident(Ident), - Str(Str), - } - pub struct TsImportEqualsDecl { - pub span: Span, - pub is_export: bool, - pub is_type_only: bool, - pub id: Ident, - pub module_ref: TsModuleRef, - } - pub enum TsModuleRef { - TsEntityName(TsEntityName), - TsExternalModuleRef(TsExternalModuleRef), - } - pub struct TsExternalModuleRef { - pub span: Span, - pub expr: Str, - } - pub struct TsExportAssignment { - pub span: Span, - pub expr: Box, - } - pub struct TsNamespaceExportDecl { - pub span: Span, - pub id: Ident, - } - pub struct TsAsExpr { - pub span: Span, - pub expr: Box, - pub type_ann: Box, - } - pub struct TsTypeAssertion { - pub span: Span, - pub expr: Box, - pub type_ann: Box, - } - pub struct TsNonNullExpr { - pub span: Span, - pub expr: Box, - } - pub enum Accessibility { - Public, - Protected, - Private, - } - pub struct TsConstAssertion { - pub span: Span, - pub expr: Box, - } - - pub struct TsInstantiation { - pub span: Span, - pub expr: Box, - pub type_args: Box, - } - - pub struct TsSatisfiesExpr { - pub span: Span, - pub expr: Box, - pub type_ann: Box, - } - - pub struct ReservedUnused { - pub span: Span, - pub body: Option>, - } - - pub struct AutoAccessor { - pub span: Span, - pub key: Key, - pub value: Option>, - pub type_ann: Option>, - pub is_static: bool, - pub decorators: Vec, - pub accessibility: Option, - pub is_override: bool, - pub definite: bool, - } - - pub enum Key { - Private(PrivateName), - Public(PropName), - } - - pub struct UsingDecl { - pub span: Span, - - pub is_await: bool, - - pub decls: Vec, - } -}); - #[macro_export] macro_rules! visit_obj_and_computed { () => { diff --git a/crates/swc_typescript/src/fast_dts/mod.rs b/crates/swc_typescript/src/fast_dts/mod.rs index 2f9dcb0e993c..c408fee9afad 100644 --- a/crates/swc_typescript/src/fast_dts/mod.rs +++ b/crates/swc_typescript/src/fast_dts/mod.rs @@ -451,6 +451,7 @@ impl FastDts { | Expr::JSXEmpty(_) | Expr::JSXElement(_) | Expr::JSXFragment(_) + | Expr::ContentTagExpression(_) | Expr::TsTypeAssertion(_) | Expr::TsNonNull(_) | Expr::TsInstantiation(_) @@ -656,6 +657,7 @@ impl FastDts { | Expr::SuperProp(_) | Expr::Fn(_) | Expr::This(_) + | Expr::ContentTagExpression(_) | Expr::Invalid(_) => false, } } @@ -744,6 +746,7 @@ impl FastDts { | ClassMember::Empty(_) | ClassMember::StaticBlock(_) | ClassMember::AutoAccessor(_) + | ClassMember::ContentTagMember(_) | ClassMember::PrivateMethod(_) => { prev_is_overload = false; true @@ -799,6 +802,7 @@ impl FastDts { | ClassMember::PrivateProp(_) | ClassMember::Empty(_) | ClassMember::StaticBlock(_) + | ClassMember::ContentTagMember(_) | ClassMember::AutoAccessor(_) => None, }) .collect(); @@ -1071,6 +1075,7 @@ fn valid_prop_name(prop_name: &PropName) -> Option { | Expr::JSXEmpty(_) | Expr::JSXElement(_) | Expr::JSXFragment(_) + | Expr::ContentTagExpression(_) | Expr::TsInstantiation(_) | Expr::PrivateName(_) | Expr::OptChain(_)