Skip to content

Commit f6f92db

Browse files
committed
refactor(ast): re-order generated code (#8863)
Change order in which source files are processed by `oxc_ast_tools`, so `oxc_ast/src/ast/js.rs` is first. This doesn't modify any code, just changes the order of generated methods. Notably `Program` appears first. This will be useful later, for simplifying generation of `Visit` trait.
1 parent f69de07 commit f6f92db

11 files changed

Lines changed: 6528 additions & 6528 deletions

File tree

crates/oxc_ast/src/generated/assert_layouts.rs

Lines changed: 316 additions & 316 deletions
Large diffs are not rendered by default.

crates/oxc_ast/src/generated/ast_builder.rs

Lines changed: 3438 additions & 3438 deletions
Large diffs are not rendered by default.

crates/oxc_ast/src/generated/ast_kind.rs

Lines changed: 375 additions & 375 deletions
Large diffs are not rendered by default.

crates/oxc_ast/src/generated/derive_clone_in.rs

Lines changed: 709 additions & 709 deletions
Large diffs are not rendered by default.

crates/oxc_ast/src/generated/derive_content_eq.rs

Lines changed: 245 additions & 245 deletions
Large diffs are not rendered by default.

crates/oxc_ast/src/generated/derive_estree.rs

Lines changed: 448 additions & 448 deletions
Large diffs are not rendered by default.

crates/oxc_ast/src/generated/derive_get_address.rs

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,81 @@ impl GetAddress for ExportDefaultDeclarationKind<'_> {
522522
}
523523
}
524524

525+
impl GetAddress for JSXElementName<'_> {
526+
// `#[inline]` because compiler should boil this down to a single assembly instruction
527+
#[inline]
528+
fn address(&self) -> Address {
529+
match self {
530+
Self::Identifier(it) => GetAddress::address(it),
531+
Self::IdentifierReference(it) => GetAddress::address(it),
532+
Self::NamespacedName(it) => GetAddress::address(it),
533+
Self::MemberExpression(it) => GetAddress::address(it),
534+
Self::ThisExpression(it) => GetAddress::address(it),
535+
}
536+
}
537+
}
538+
539+
impl GetAddress for JSXMemberExpressionObject<'_> {
540+
// `#[inline]` because compiler should boil this down to a single assembly instruction
541+
#[inline]
542+
fn address(&self) -> Address {
543+
match self {
544+
Self::IdentifierReference(it) => GetAddress::address(it),
545+
Self::MemberExpression(it) => GetAddress::address(it),
546+
Self::ThisExpression(it) => GetAddress::address(it),
547+
}
548+
}
549+
}
550+
551+
impl GetAddress for JSXAttributeItem<'_> {
552+
// `#[inline]` because compiler should boil this down to a single assembly instruction
553+
#[inline]
554+
fn address(&self) -> Address {
555+
match self {
556+
Self::Attribute(it) => GetAddress::address(it),
557+
Self::SpreadAttribute(it) => GetAddress::address(it),
558+
}
559+
}
560+
}
561+
562+
impl GetAddress for JSXAttributeName<'_> {
563+
// `#[inline]` because compiler should boil this down to a single assembly instruction
564+
#[inline]
565+
fn address(&self) -> Address {
566+
match self {
567+
Self::Identifier(it) => GetAddress::address(it),
568+
Self::NamespacedName(it) => GetAddress::address(it),
569+
}
570+
}
571+
}
572+
573+
impl GetAddress for JSXAttributeValue<'_> {
574+
// `#[inline]` because compiler should boil this down to a single assembly instruction
575+
#[inline]
576+
fn address(&self) -> Address {
577+
match self {
578+
Self::StringLiteral(it) => GetAddress::address(it),
579+
Self::ExpressionContainer(it) => GetAddress::address(it),
580+
Self::Element(it) => GetAddress::address(it),
581+
Self::Fragment(it) => GetAddress::address(it),
582+
}
583+
}
584+
}
585+
586+
impl GetAddress for JSXChild<'_> {
587+
// `#[inline]` because compiler should boil this down to a single assembly instruction
588+
#[inline]
589+
fn address(&self) -> Address {
590+
match self {
591+
Self::Text(it) => GetAddress::address(it),
592+
Self::Element(it) => GetAddress::address(it),
593+
Self::Fragment(it) => GetAddress::address(it),
594+
Self::ExpressionContainer(it) => GetAddress::address(it),
595+
Self::Spread(it) => GetAddress::address(it),
596+
}
597+
}
598+
}
599+
525600
impl GetAddress for TSEnumMemberName<'_> {
526601
// `#[inline]` because compiler should boil this down to a single assembly instruction
527602
#[inline]
@@ -705,78 +780,3 @@ impl GetAddress for TSModuleReference<'_> {
705780
}
706781
}
707782
}
708-
709-
impl GetAddress for JSXElementName<'_> {
710-
// `#[inline]` because compiler should boil this down to a single assembly instruction
711-
#[inline]
712-
fn address(&self) -> Address {
713-
match self {
714-
Self::Identifier(it) => GetAddress::address(it),
715-
Self::IdentifierReference(it) => GetAddress::address(it),
716-
Self::NamespacedName(it) => GetAddress::address(it),
717-
Self::MemberExpression(it) => GetAddress::address(it),
718-
Self::ThisExpression(it) => GetAddress::address(it),
719-
}
720-
}
721-
}
722-
723-
impl GetAddress for JSXMemberExpressionObject<'_> {
724-
// `#[inline]` because compiler should boil this down to a single assembly instruction
725-
#[inline]
726-
fn address(&self) -> Address {
727-
match self {
728-
Self::IdentifierReference(it) => GetAddress::address(it),
729-
Self::MemberExpression(it) => GetAddress::address(it),
730-
Self::ThisExpression(it) => GetAddress::address(it),
731-
}
732-
}
733-
}
734-
735-
impl GetAddress for JSXAttributeItem<'_> {
736-
// `#[inline]` because compiler should boil this down to a single assembly instruction
737-
#[inline]
738-
fn address(&self) -> Address {
739-
match self {
740-
Self::Attribute(it) => GetAddress::address(it),
741-
Self::SpreadAttribute(it) => GetAddress::address(it),
742-
}
743-
}
744-
}
745-
746-
impl GetAddress for JSXAttributeName<'_> {
747-
// `#[inline]` because compiler should boil this down to a single assembly instruction
748-
#[inline]
749-
fn address(&self) -> Address {
750-
match self {
751-
Self::Identifier(it) => GetAddress::address(it),
752-
Self::NamespacedName(it) => GetAddress::address(it),
753-
}
754-
}
755-
}
756-
757-
impl GetAddress for JSXAttributeValue<'_> {
758-
// `#[inline]` because compiler should boil this down to a single assembly instruction
759-
#[inline]
760-
fn address(&self) -> Address {
761-
match self {
762-
Self::StringLiteral(it) => GetAddress::address(it),
763-
Self::ExpressionContainer(it) => GetAddress::address(it),
764-
Self::Element(it) => GetAddress::address(it),
765-
Self::Fragment(it) => GetAddress::address(it),
766-
}
767-
}
768-
}
769-
770-
impl GetAddress for JSXChild<'_> {
771-
// `#[inline]` because compiler should boil this down to a single assembly instruction
772-
#[inline]
773-
fn address(&self) -> Address {
774-
match self {
775-
Self::Text(it) => GetAddress::address(it),
776-
Self::Element(it) => GetAddress::address(it),
777-
Self::Fragment(it) => GetAddress::address(it),
778-
Self::ExpressionContainer(it) => GetAddress::address(it),
779-
Self::Spread(it) => GetAddress::address(it),
780-
}
781-
}
782-
}

0 commit comments

Comments
 (0)