refactor(ast): remove inherit_variants! from TSEnumMemberName (#7248)

#7219 removed all variants of `TSEnumMemberName` except `IdentifierName` and `StringLiteral`. It no longer inherits variants from `Expression`, so we can remove the `inherit_variants!` macro wrapper.

The discriminants no longer need to avoid clashes with `Expression`'s, so they can start at 0.
This commit is contained in:
overlookmotel 2024-11-12 12:22:20 +00:00
parent 62b6327879
commit d3d58f8ace

View file

@ -102,20 +102,13 @@ pub struct TSEnumMember<'a> {
pub initializer: Option<Expression<'a>>, pub initializer: Option<Expression<'a>>,
} }
inherit_variants! {
/// TS Enum Member Name /// TS Enum Member Name
///
/// Used in [`TSEnumMember`]. Inherits variants from [`Expression`]. See [`ast` module docs] for
/// explanation of inheritance.
///
/// [`ast` module docs]: `super`
#[ast(visit)] #[ast(visit)]
#[derive(Debug)] #[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)] #[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
pub enum TSEnumMemberName<'a> { pub enum TSEnumMemberName<'a> {
StaticIdentifier(Box<'a, IdentifierName<'a>>) = 64, StaticIdentifier(Box<'a, IdentifierName<'a>>) = 0,
StaticStringLiteral(Box<'a, StringLiteral<'a>>) = 65, StaticStringLiteral(Box<'a, StringLiteral<'a>>) = 1,
}
} }
/// TypeScript Type Annotation /// TypeScript Type Annotation