mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
parent
9b77d0e6e6
commit
ac4b3a4f8d
3 changed files with 25 additions and 0 deletions
|
|
@ -160,6 +160,7 @@ pub enum AstKind<'a> {
|
||||||
TSModuleDeclaration(&'a TSModuleDeclaration<'a>),
|
TSModuleDeclaration(&'a TSModuleDeclaration<'a>),
|
||||||
TSTypeAliasDeclaration(&'a TSTypeAliasDeclaration<'a>),
|
TSTypeAliasDeclaration(&'a TSTypeAliasDeclaration<'a>),
|
||||||
TSTypeAnnotation(&'a TSTypeAnnotation<'a>),
|
TSTypeAnnotation(&'a TSTypeAnnotation<'a>),
|
||||||
|
TSTypeQuery(&'a TSTypeQuery<'a>),
|
||||||
TSTypeAssertion(&'a TSTypeAssertion<'a>),
|
TSTypeAssertion(&'a TSTypeAssertion<'a>),
|
||||||
TSTypeParameter(&'a TSTypeParameter<'a>),
|
TSTypeParameter(&'a TSTypeParameter<'a>),
|
||||||
TSTypeParameterDeclaration(&'a TSTypeParameterDeclaration<'a>),
|
TSTypeParameterDeclaration(&'a TSTypeParameterDeclaration<'a>),
|
||||||
|
|
@ -467,6 +468,7 @@ impl<'a> GetSpan for AstKind<'a> {
|
||||||
Self::TSModuleDeclaration(x) => x.span,
|
Self::TSModuleDeclaration(x) => x.span,
|
||||||
Self::TSTypeAliasDeclaration(x) => x.span,
|
Self::TSTypeAliasDeclaration(x) => x.span,
|
||||||
Self::TSTypeAnnotation(x) => x.span,
|
Self::TSTypeAnnotation(x) => x.span,
|
||||||
|
Self::TSTypeQuery(x) => x.span,
|
||||||
Self::TSTypeAssertion(x) => x.span,
|
Self::TSTypeAssertion(x) => x.span,
|
||||||
Self::TSTypeParameter(x) => x.span,
|
Self::TSTypeParameter(x) => x.span,
|
||||||
Self::TSTypeParameterDeclaration(x) => x.span,
|
Self::TSTypeParameterDeclaration(x) => x.span,
|
||||||
|
|
@ -647,6 +649,7 @@ impl<'a> AstKind<'a> {
|
||||||
Self::TSModuleDeclaration(_) => "TSModuleDeclaration".into(),
|
Self::TSModuleDeclaration(_) => "TSModuleDeclaration".into(),
|
||||||
Self::TSTypeAliasDeclaration(_) => "TSTypeAliasDeclaration".into(),
|
Self::TSTypeAliasDeclaration(_) => "TSTypeAliasDeclaration".into(),
|
||||||
Self::TSTypeAnnotation(_) => "TSTypeAnnotation".into(),
|
Self::TSTypeAnnotation(_) => "TSTypeAnnotation".into(),
|
||||||
|
Self::TSTypeQuery(_) => "TSTypeQuery".into(),
|
||||||
Self::TSTypeAssertion(_) => "TSTypeAssertion".into(),
|
Self::TSTypeAssertion(_) => "TSTypeAssertion".into(),
|
||||||
Self::TSTypeParameter(_) => "TSTypeParameter".into(),
|
Self::TSTypeParameter(_) => "TSTypeParameter".into(),
|
||||||
Self::TSTypeParameterDeclaration(_) => "TSTypeParameterDeclaration".into(),
|
Self::TSTypeParameterDeclaration(_) => "TSTypeParameterDeclaration".into(),
|
||||||
|
|
|
||||||
|
|
@ -1600,6 +1600,7 @@ pub trait Visit<'a>: Sized {
|
||||||
TSType::TSTypePredicate(ty) => self.visit_ts_type_predicate(ty),
|
TSType::TSTypePredicate(ty) => self.visit_ts_type_predicate(ty),
|
||||||
TSType::TSTypeLiteral(ty) => self.visit_ts_type_literal(ty),
|
TSType::TSTypeLiteral(ty) => self.visit_ts_type_literal(ty),
|
||||||
TSType::TSIndexedAccessType(ty) => self.visit_ts_indexed_access_type(ty),
|
TSType::TSIndexedAccessType(ty) => self.visit_ts_indexed_access_type(ty),
|
||||||
|
TSType::TSTypeQuery(ty) => self.visit_ts_type_query(ty),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1850,4 +1851,14 @@ pub trait Visit<'a>: Sized {
|
||||||
self.visit_ts_type_annotation(annotation);
|
self.visit_ts_type_annotation(annotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visit_ts_type_query(&mut self, ty: &TSTypeQuery<'a>) {
|
||||||
|
let kind = AstKind::TSTypeQuery(self.alloc(ty));
|
||||||
|
self.enter_node(kind);
|
||||||
|
self.visit_ts_type_name(&ty.expr_name);
|
||||||
|
if let Some(type_parameters) = &ty.type_parameters {
|
||||||
|
self.visit_ts_type_parameter_instantiation(type_parameters);
|
||||||
|
}
|
||||||
|
self.leave_node(kind);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1595,6 +1595,7 @@ pub trait VisitMut<'a>: Sized {
|
||||||
TSType::TSTypePredicate(ty) => self.visit_ts_type_predicate(ty),
|
TSType::TSTypePredicate(ty) => self.visit_ts_type_predicate(ty),
|
||||||
TSType::TSTypeLiteral(ty) => self.visit_ts_type_literal(ty),
|
TSType::TSTypeLiteral(ty) => self.visit_ts_type_literal(ty),
|
||||||
TSType::TSIndexedAccessType(ty) => self.visit_ts_indexed_access_type(ty),
|
TSType::TSIndexedAccessType(ty) => self.visit_ts_indexed_access_type(ty),
|
||||||
|
TSType::TSTypeQuery(ty) => self.visit_ts_type_query(ty),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1848,4 +1849,14 @@ pub trait VisitMut<'a>: Sized {
|
||||||
self.visit_ts_type_annotation(annotation);
|
self.visit_ts_type_annotation(annotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visit_ts_type_query(&mut self, ty: &mut TSTypeQuery<'a>) {
|
||||||
|
let kind = AstKind::TSTypeQuery(self.alloc(ty));
|
||||||
|
self.enter_node(kind);
|
||||||
|
self.visit_ts_type_name(&mut ty.expr_name);
|
||||||
|
if let Some(type_parameters) = &mut ty.type_parameters {
|
||||||
|
self.visit_ts_type_parameter_instantiation(type_parameters);
|
||||||
|
}
|
||||||
|
self.leave_node(kind);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue