Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(ast): add AstKind::TSExportAssignment (#4501)
part of #4488
  • Loading branch information
Dunqing committed Jul 27, 2024
commit 2477330440bcdab5c72985b4fb61a71e08e218d7
1 change: 1 addition & 0 deletions crates/oxc_ast/src/ast_kind_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ impl<'a> AstKind<'a> {
Self::TSMappedType(_) => "TSMappedType".into(),
Self::TSConstructSignatureDeclaration(_) => "TSConstructSignatureDeclaration".into(),
Self::TSModuleReference(_) => "TSModuleReference".into(),
Self::TSExportAssignment(_) => "TSExportAssignment".into(),
}
}
}
3 changes: 3 additions & 0 deletions crates/oxc_ast/src/generated/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ pub enum AstType {
TSExternalModuleReference,
TSNonNullExpression,
Decorator,
TSExportAssignment,
TSInstantiationExpression,
JSXElement,
JSXOpeningElement,
Expand Down Expand Up @@ -332,6 +333,7 @@ pub enum AstKind<'a> {
TSExternalModuleReference(&'a TSExternalModuleReference<'a>),
TSNonNullExpression(&'a TSNonNullExpression<'a>),
Decorator(&'a Decorator<'a>),
TSExportAssignment(&'a TSExportAssignment<'a>),
TSInstantiationExpression(&'a TSInstantiationExpression<'a>),
JSXElement(&'a JSXElement<'a>),
JSXOpeningElement(&'a JSXOpeningElement<'a>),
Expand Down Expand Up @@ -506,6 +508,7 @@ impl<'a> GetSpan for AstKind<'a> {
Self::TSExternalModuleReference(it) => it.span(),
Self::TSNonNullExpression(it) => it.span(),
Self::Decorator(it) => it.span(),
Self::TSExportAssignment(it) => it.span(),
Self::TSInstantiationExpression(it) => it.span(),
Self::JSXElement(it) => it.span(),
Self::JSXOpeningElement(it) => it.span(),
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_ast/src/generated/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4207,8 +4207,10 @@ pub mod walk {
visitor: &mut V,
it: &TSExportAssignment<'a>,
) {
// NOTE: AstKind doesn't exists!
let kind = AstKind::TSExportAssignment(visitor.alloc(it));
visitor.enter_node(kind);
visitor.visit_expression(&it.expression);
visitor.leave_node(kind);
}

#[inline]
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_ast/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4452,8 +4452,10 @@ pub mod walk_mut {
visitor: &mut V,
it: &mut TSExportAssignment<'a>,
) {
// NOTE: AstType doesn't exists!
let kind = AstType::TSExportAssignment;
visitor.enter_node(kind);
visitor.visit_expression(&mut it.expression);
visitor.leave_node(kind);
}

#[inline]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals1.
"flag": "ReferenceFlag(Read)",
"id": 0,
"name": "x",
"node_id": 6
"node_id": 7
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ input_file: crates/oxc_semantic/tests/fixtures/typescript-eslint/export/equals4-
"flag": "ReferenceFlag(Type)",
"id": 0,
"name": "T",
"node_id": 10
"node_id": 11
}
]
}
Expand Down
3 changes: 1 addition & 2 deletions tasks/ast_codegen/src/generators/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::generated_header;

pub struct AstKindGenerator;

pub const BLACK_LIST: [&str; 62] = [
pub const BLACK_LIST: [&str; 61] = [
"Expression",
"ObjectPropertyKind",
"TemplateElement",
Expand Down Expand Up @@ -62,7 +62,6 @@ pub const BLACK_LIST: [&str; 62] = [
"TSImportAttributeName",
"TSFunctionType",
"TSConstructorType",
"TSExportAssignment",
"TSNamespaceExportDeclaration",
"JSDocNullableType",
"JSDocNonNullableType",
Expand Down