From ae9ed9a5619aa275f88e857cdd95a34ad6fdc2f9 Mon Sep 17 00:00:00 2001 From: rzvxa Date: Thu, 5 Sep 2024 01:45:57 +0330 Subject: [PATCH] fix: formatting by using match expression over macro. --- .../src/generated/derive_content_eq.rs | 5828 +++++++---------- .../src/generated/derive_content_eq.rs | 175 +- .../src/generated/derive_content_eq.rs | 2 + tasks/ast_tools/src/derives/content_eq.rs | 9 +- 4 files changed, 2500 insertions(+), 3514 deletions(-) diff --git a/crates/oxc_ast/src/generated/derive_content_eq.rs b/crates/oxc_ast/src/generated/derive_content_eq.rs index 61e5ed17204c2e..2a2dc50d7c0012 100644 --- a/crates/oxc_ast/src/generated/derive_content_eq.rs +++ b/crates/oxc_ast/src/generated/derive_content_eq.rs @@ -1,6 +1,8 @@ // Auto-generated code, DO NOT EDIT DIRECTLY! // To edit this generated file you have to edit `tasks/ast_tools/src/derives/content_eq.rs` +#![allow(clippy::match_like_matches_macro)] + use oxc_span::cmp::ContentEq; #[allow(clippy::wildcard_imports)] @@ -59,15 +61,18 @@ impl<'a> ContentEq for RegExp<'a> { impl<'a> ContentEq for RegExpPattern<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Raw(it) => { - matches!(other, Self::Raw(other) if ContentEq::content_eq(it, other)) - } - Self::Invalid(it) => { - matches!(other, Self::Invalid(other) if ContentEq::content_eq(it, other)) - } - Self::Pattern(it) => { - matches!(other, Self::Pattern(other) if ContentEq::content_eq(it, other)) - } + Self::Raw(it) => match other { + Self::Raw(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Invalid(it) => match other { + Self::Invalid(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Pattern(it) => match other { + Self::Pattern(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -96,246 +101,174 @@ impl<'a> ContentEq for Program<'a> { impl<'a> ContentEq for Expression<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -379,254 +312,182 @@ impl<'a> ContentEq for ArrayExpression<'a> { impl<'a> ContentEq for ArrayExpressionElement<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::SpreadElement(it) => { - matches!( - other, Self::SpreadElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::Elision(it) => { - matches!(other, Self::Elision(other) if ContentEq::content_eq(it, other)) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::SpreadElement(it) => match other { + Self::SpreadElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Elision(it) => match other { + Self::Elision(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -646,18 +507,14 @@ impl<'a> ContentEq for ObjectExpression<'a> { impl<'a> ContentEq for ObjectPropertyKind<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::ObjectProperty(it) => { - matches!( - other, Self::ObjectProperty(other) if ContentEq::content_eq(it, - other) - ) - } - Self::SpreadProperty(it) => { - matches!( - other, Self::SpreadProperty(other) if ContentEq::content_eq(it, - other) - ) - } + Self::ObjectProperty(it) => match other { + Self::ObjectProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SpreadProperty(it) => match other { + Self::SpreadProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -677,258 +534,182 @@ impl<'a> ContentEq for ObjectProperty<'a> { impl<'a> ContentEq for PropertyKey<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::StaticIdentifier(it) => { - matches!( - other, Self::StaticIdentifier(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateIdentifier(it) => { - matches!( - other, Self::PrivateIdentifier(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::StaticIdentifier(it) => match other { + Self::StaticIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateIdentifier(it) => match other { + Self::PrivateIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -971,24 +752,18 @@ impl<'a> ContentEq for TemplateElementValue<'a> { impl<'a> ContentEq for MemberExpression<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1050,251 +825,178 @@ impl<'a> ContentEq for SpreadElement<'a> { impl<'a> ContentEq for Argument<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::SpreadElement(it) => { - matches!( - other, Self::SpreadElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::SpreadElement(it) => match other { + Self::SpreadElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1357,72 +1059,50 @@ impl<'a> ContentEq for AssignmentExpression<'a> { impl<'a> ContentEq for AssignmentTarget<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::AssignmentTargetIdentifier(it) => { - matches!( - other, Self::AssignmentTargetIdentifier(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ArrayAssignmentTarget(it) => { - matches!( - other, Self::ArrayAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ObjectAssignmentTarget(it) => { - matches!( - other, Self::ObjectAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } + Self::AssignmentTargetIdentifier(it) => match other { + Self::AssignmentTargetIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayAssignmentTarget(it) => match other { + Self::ArrayAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectAssignmentTarget(it) => match other { + Self::ObjectAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1430,60 +1110,42 @@ impl<'a> ContentEq for AssignmentTarget<'a> { impl<'a> ContentEq for SimpleAssignmentTarget<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::AssignmentTargetIdentifier(it) => { - matches!( - other, Self::AssignmentTargetIdentifier(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::AssignmentTargetIdentifier(it) => match other { + Self::AssignmentTargetIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1491,18 +1153,14 @@ impl<'a> ContentEq for SimpleAssignmentTarget<'a> { impl<'a> ContentEq for AssignmentTargetPattern<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::ArrayAssignmentTarget(it) => { - matches!( - other, Self::ArrayAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ObjectAssignmentTarget(it) => { - matches!( - other, Self::ObjectAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } + Self::ArrayAssignmentTarget(it) => match other { + Self::ArrayAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectAssignmentTarget(it) => match other { + Self::ObjectAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1530,78 +1188,56 @@ impl<'a> ContentEq for AssignmentTargetRest<'a> { impl<'a> ContentEq for AssignmentTargetMaybeDefault<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::AssignmentTargetWithDefault(it) => { - matches!( - other, Self::AssignmentTargetWithDefault(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentTargetIdentifier(it) => { - matches!( - other, Self::AssignmentTargetIdentifier(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ArrayAssignmentTarget(it) => { - matches!( - other, Self::ArrayAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ObjectAssignmentTarget(it) => { - matches!( - other, Self::ObjectAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } + Self::AssignmentTargetWithDefault(it) => match other { + Self::AssignmentTargetWithDefault(other) if ContentEq::content_eq(it, other) => { + true + } + _ => false, + }, + Self::AssignmentTargetIdentifier(it) => match other { + Self::AssignmentTargetIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayAssignmentTarget(it) => match other { + Self::ArrayAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectAssignmentTarget(it) => match other { + Self::ObjectAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1616,18 +1252,22 @@ impl<'a> ContentEq for AssignmentTargetWithDefault<'a> { impl<'a> ContentEq for AssignmentTargetProperty<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::AssignmentTargetPropertyIdentifier(it) => { - matches!( - other, Self::AssignmentTargetPropertyIdentifier(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentTargetPropertyProperty(it) => { - matches!( - other, Self::AssignmentTargetPropertyProperty(other) if - ContentEq::content_eq(it, other) - ) - } + Self::AssignmentTargetPropertyIdentifier(it) => match other { + Self::AssignmentTargetPropertyIdentifier(other) + if ContentEq::content_eq(it, other) => + { + true + } + _ => false, + }, + Self::AssignmentTargetPropertyProperty(it) => match other { + Self::AssignmentTargetPropertyProperty(other) + if ContentEq::content_eq(it, other) => + { + true + } + _ => false, + }, } } } @@ -1673,30 +1313,22 @@ impl<'a> ContentEq for ChainExpression<'a> { impl<'a> ContentEq for ChainElement<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -1710,194 +1342,136 @@ impl<'a> ContentEq for ParenthesizedExpression<'a> { impl<'a> ContentEq for Statement<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::BlockStatement(it) => { - matches!( - other, Self::BlockStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BreakStatement(it) => { - matches!( - other, Self::BreakStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ContinueStatement(it) => { - matches!( - other, Self::ContinueStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::DebuggerStatement(it) => { - matches!( - other, Self::DebuggerStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::DoWhileStatement(it) => { - matches!( - other, Self::DoWhileStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::EmptyStatement(it) => { - matches!( - other, Self::EmptyStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ExpressionStatement(it) => { - matches!( - other, Self::ExpressionStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ForInStatement(it) => { - matches!( - other, Self::ForInStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ForOfStatement(it) => { - matches!( - other, Self::ForOfStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ForStatement(it) => { - matches!( - other, Self::ForStatement(other) if ContentEq::content_eq(it, other) - ) - } - Self::IfStatement(it) => { - matches!( - other, Self::IfStatement(other) if ContentEq::content_eq(it, other) - ) - } - Self::LabeledStatement(it) => { - matches!( - other, Self::LabeledStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ReturnStatement(it) => { - matches!( - other, Self::ReturnStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::SwitchStatement(it) => { - matches!( - other, Self::SwitchStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ThrowStatement(it) => { - matches!( - other, Self::ThrowStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TryStatement(it) => { - matches!( - other, Self::TryStatement(other) if ContentEq::content_eq(it, other) - ) - } - Self::WhileStatement(it) => { - matches!( - other, Self::WhileStatement(other) if ContentEq::content_eq(it, - other) - ) - } - Self::WithStatement(it) => { - matches!( - other, Self::WithStatement(other) if ContentEq::content_eq(it, other) - ) - } - Self::VariableDeclaration(it) => { - matches!( - other, Self::VariableDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::FunctionDeclaration(it) => { - matches!( - other, Self::FunctionDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassDeclaration(it) => { - matches!( - other, Self::ClassDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeAliasDeclaration(it) => { - matches!( - other, Self::TSTypeAliasDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSInterfaceDeclaration(it) => { - matches!( - other, Self::TSInterfaceDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSEnumDeclaration(it) => { - matches!( - other, Self::TSEnumDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSModuleDeclaration(it) => { - matches!( - other, Self::TSModuleDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSImportEqualsDeclaration(it) => { - matches!( - other, Self::TSImportEqualsDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ImportDeclaration(it) => { - matches!( - other, Self::ImportDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ExportAllDeclaration(it) => { - matches!( - other, Self::ExportAllDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ExportDefaultDeclaration(it) => { - matches!( - other, Self::ExportDefaultDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ExportNamedDeclaration(it) => { - matches!( - other, Self::ExportNamedDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSExportAssignment(it) => { - matches!( - other, Self::TSExportAssignment(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNamespaceExportDeclaration(it) => { - matches!( - other, Self::TSNamespaceExportDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } + Self::BlockStatement(it) => match other { + Self::BlockStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BreakStatement(it) => match other { + Self::BreakStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ContinueStatement(it) => match other { + Self::ContinueStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::DebuggerStatement(it) => match other { + Self::DebuggerStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::DoWhileStatement(it) => match other { + Self::DoWhileStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::EmptyStatement(it) => match other { + Self::EmptyStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExpressionStatement(it) => match other { + Self::ExpressionStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ForInStatement(it) => match other { + Self::ForInStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ForOfStatement(it) => match other { + Self::ForOfStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ForStatement(it) => match other { + Self::ForStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IfStatement(it) => match other { + Self::IfStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LabeledStatement(it) => match other { + Self::LabeledStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ReturnStatement(it) => match other { + Self::ReturnStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SwitchStatement(it) => match other { + Self::SwitchStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThrowStatement(it) => match other { + Self::ThrowStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TryStatement(it) => match other { + Self::TryStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::WhileStatement(it) => match other { + Self::WhileStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::WithStatement(it) => match other { + Self::WithStatement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::VariableDeclaration(it) => match other { + Self::VariableDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionDeclaration(it) => match other { + Self::FunctionDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassDeclaration(it) => match other { + Self::ClassDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAliasDeclaration(it) => match other { + Self::TSTypeAliasDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInterfaceDeclaration(it) => match other { + Self::TSInterfaceDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSEnumDeclaration(it) => match other { + Self::TSEnumDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSModuleDeclaration(it) => match other { + Self::TSModuleDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSImportEqualsDeclaration(it) => match other { + Self::TSImportEqualsDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportDeclaration(it) => match other { + Self::ImportDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExportAllDeclaration(it) => match other { + Self::ExportAllDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExportDefaultDeclaration(it) => match other { + Self::ExportDefaultDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExportNamedDeclaration(it) => match other { + Self::ExportNamedDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSExportAssignment(it) => match other { + Self::TSExportAssignment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNamespaceExportDeclaration(it) => match other { + Self::TSNamespaceExportDeclaration(other) if ContentEq::content_eq(it, other) => { + true + } + _ => false, + }, } } } @@ -1924,54 +1498,38 @@ impl<'a> ContentEq for BlockStatement<'a> { impl<'a> ContentEq for Declaration<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::VariableDeclaration(it) => { - matches!( - other, Self::VariableDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::FunctionDeclaration(it) => { - matches!( - other, Self::FunctionDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassDeclaration(it) => { - matches!( - other, Self::ClassDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeAliasDeclaration(it) => { - matches!( - other, Self::TSTypeAliasDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSInterfaceDeclaration(it) => { - matches!( - other, Self::TSInterfaceDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSEnumDeclaration(it) => { - matches!( - other, Self::TSEnumDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSModuleDeclaration(it) => { - matches!( - other, Self::TSModuleDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSImportEqualsDeclaration(it) => { - matches!( - other, Self::TSImportEqualsDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } + Self::VariableDeclaration(it) => match other { + Self::VariableDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionDeclaration(it) => match other { + Self::FunctionDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassDeclaration(it) => match other { + Self::ClassDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAliasDeclaration(it) => match other { + Self::TSTypeAliasDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInterfaceDeclaration(it) => match other { + Self::TSInterfaceDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSEnumDeclaration(it) => match other { + Self::TSEnumDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSModuleDeclaration(it) => match other { + Self::TSModuleDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSImportEqualsDeclaration(it) => match other { + Self::TSImportEqualsDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2045,252 +1603,178 @@ impl<'a> ContentEq for ForStatement<'a> { impl<'a> ContentEq for ForStatementInit<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::VariableDeclaration(it) => { - matches!( - other, Self::VariableDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::VariableDeclaration(it) => match other { + Self::VariableDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2306,78 +1790,54 @@ impl<'a> ContentEq for ForInStatement<'a> { impl<'a> ContentEq for ForStatementLeft<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::VariableDeclaration(it) => { - matches!( - other, Self::VariableDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AssignmentTargetIdentifier(it) => { - matches!( - other, Self::AssignmentTargetIdentifier(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ArrayAssignmentTarget(it) => { - matches!( - other, Self::ArrayAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ObjectAssignmentTarget(it) => { - matches!( - other, Self::ObjectAssignmentTarget(other) if - ContentEq::content_eq(it, other) - ) - } + Self::VariableDeclaration(it) => match other { + Self::VariableDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentTargetIdentifier(it) => match other { + Self::AssignmentTargetIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayAssignmentTarget(it) => match other { + Self::ArrayAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectAssignmentTarget(it) => match other { + Self::ObjectAssignmentTarget(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2481,28 +1941,22 @@ impl<'a> ContentEq for BindingPattern<'a> { impl<'a> ContentEq for BindingPatternKind<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::BindingIdentifier(it) => { - matches!( - other, Self::BindingIdentifier(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ObjectPattern(it) => { - matches!( - other, Self::ObjectPattern(other) if ContentEq::content_eq(it, other) - ) - } - Self::ArrayPattern(it) => { - matches!( - other, Self::ArrayPattern(other) if ContentEq::content_eq(it, other) - ) - } - Self::AssignmentPattern(it) => { - matches!( - other, Self::AssignmentPattern(other) if ContentEq::content_eq(it, - other) - ) - } + Self::BindingIdentifier(it) => match other { + Self::BindingIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectPattern(it) => match other { + Self::ObjectPattern(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayPattern(it) => match other { + Self::ArrayPattern(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentPattern(it) => match other { + Self::AssignmentPattern(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2643,35 +2097,26 @@ impl<'a> ContentEq for ClassBody<'a> { impl<'a> ContentEq for ClassElement<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::StaticBlock(it) => { - matches!( - other, Self::StaticBlock(other) if ContentEq::content_eq(it, other) - ) - } - Self::MethodDefinition(it) => { - matches!( - other, Self::MethodDefinition(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PropertyDefinition(it) => { - matches!( - other, Self::PropertyDefinition(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AccessorProperty(it) => { - matches!( - other, Self::AccessorProperty(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSIndexSignature(it) => { - matches!( - other, Self::TSIndexSignature(other) if ContentEq::content_eq(it, - other) - ) - } + Self::StaticBlock(it) => match other { + Self::StaticBlock(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MethodDefinition(it) => match other { + Self::MethodDefinition(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PropertyDefinition(it) => match other { + Self::PropertyDefinition(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AccessorProperty(it) => match other { + Self::AccessorProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIndexSignature(it) => match other { + Self::TSIndexSignature(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2742,42 +2187,32 @@ impl<'a> ContentEq for StaticBlock<'a> { impl<'a> ContentEq for ModuleDeclaration<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::ImportDeclaration(it) => { - matches!( - other, Self::ImportDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ExportAllDeclaration(it) => { - matches!( - other, Self::ExportAllDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ExportDefaultDeclaration(it) => { - matches!( - other, Self::ExportDefaultDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ExportNamedDeclaration(it) => { - matches!( - other, Self::ExportNamedDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSExportAssignment(it) => { - matches!( - other, Self::TSExportAssignment(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNamespaceExportDeclaration(it) => { - matches!( - other, Self::TSNamespaceExportDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } + Self::ImportDeclaration(it) => match other { + Self::ImportDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExportAllDeclaration(it) => match other { + Self::ExportAllDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExportDefaultDeclaration(it) => match other { + Self::ExportDefaultDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExportNamedDeclaration(it) => match other { + Self::ExportNamedDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSExportAssignment(it) => match other { + Self::TSExportAssignment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNamespaceExportDeclaration(it) => match other { + Self::TSNamespaceExportDeclaration(other) if ContentEq::content_eq(it, other) => { + true + } + _ => false, + }, } } } @@ -2821,24 +2256,18 @@ impl<'a> ContentEq for ImportDeclaration<'a> { impl<'a> ContentEq for ImportDeclarationSpecifier<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::ImportSpecifier(it) => { - matches!( - other, Self::ImportSpecifier(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportDefaultSpecifier(it) => { - matches!( - other, Self::ImportDefaultSpecifier(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ImportNamespaceSpecifier(it) => { - matches!( - other, Self::ImportNamespaceSpecifier(other) if - ContentEq::content_eq(it, other) - ) - } + Self::ImportSpecifier(it) => match other { + Self::ImportSpecifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportDefaultSpecifier(it) => match other { + Self::ImportDefaultSpecifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportNamespaceSpecifier(it) => match other { + Self::ImportNamespaceSpecifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2880,16 +2309,14 @@ impl<'a> ContentEq for ImportAttribute<'a> { impl<'a> ContentEq for ImportAttributeKey<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -2931,264 +2358,186 @@ impl<'a> ContentEq for ExportSpecifier<'a> { impl<'a> ContentEq for ExportDefaultDeclarationKind<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::FunctionDeclaration(it) => { - matches!( - other, Self::FunctionDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassDeclaration(it) => { - matches!( - other, Self::ClassDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInterfaceDeclaration(it) => { - matches!( - other, Self::TSInterfaceDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::FunctionDeclaration(it) => match other { + Self::FunctionDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassDeclaration(it) => match other { + Self::ClassDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInterfaceDeclaration(it) => match other { + Self::TSInterfaceDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -3196,23 +2545,18 @@ impl<'a> ContentEq for ExportDefaultDeclarationKind<'a> { impl<'a> ContentEq for ModuleExportName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::IdentifierName(it) => { - matches!( - other, Self::IdentifierName(other) if ContentEq::content_eq(it, - other) - ) - } - Self::IdentifierReference(it) => { - matches!( - other, Self::IdentifierReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } + Self::IdentifierName(it) => match other { + Self::IdentifierName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IdentifierReference(it) => match other { + Self::IdentifierReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -3242,270 +2586,190 @@ impl<'a> ContentEq for TSEnumMember<'a> { impl<'a> ContentEq for TSEnumMemberName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::StaticIdentifier(it) => { - matches!( - other, Self::StaticIdentifier(other) if ContentEq::content_eq(it, - other) - ) - } - Self::StaticStringLiteral(it) => { - matches!( - other, Self::StaticStringLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::StaticTemplateLiteral(it) => { - matches!( - other, Self::StaticTemplateLiteral(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticNumericLiteral(it) => { - matches!( - other, Self::StaticNumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::StaticIdentifier(it) => match other { + Self::StaticIdentifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticStringLiteral(it) => match other { + Self::StaticStringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticTemplateLiteral(it) => match other { + Self::StaticTemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticNumericLiteral(it) => match other { + Self::StaticNumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -3525,50 +2789,38 @@ impl<'a> ContentEq for TSLiteralType<'a> { impl<'a> ContentEq for TSLiteral<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -3576,221 +2828,158 @@ impl<'a> ContentEq for TSLiteral<'a> { impl<'a> ContentEq for TSType<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::TSAnyKeyword(it) => { - matches!( - other, Self::TSAnyKeyword(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSBigIntKeyword(it) => { - matches!( - other, Self::TSBigIntKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSBooleanKeyword(it) => { - matches!( - other, Self::TSBooleanKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSIntrinsicKeyword(it) => { - matches!( - other, Self::TSIntrinsicKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNeverKeyword(it) => { - matches!( - other, Self::TSNeverKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNullKeyword(it) => { - matches!( - other, Self::TSNullKeyword(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSNumberKeyword(it) => { - matches!( - other, Self::TSNumberKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSObjectKeyword(it) => { - matches!( - other, Self::TSObjectKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSStringKeyword(it) => { - matches!( - other, Self::TSStringKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSymbolKeyword(it) => { - matches!( - other, Self::TSSymbolKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSUndefinedKeyword(it) => { - matches!( - other, Self::TSUndefinedKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSUnknownKeyword(it) => { - matches!( - other, Self::TSUnknownKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSVoidKeyword(it) => { - matches!( - other, Self::TSVoidKeyword(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSArrayType(it) => { - matches!( - other, Self::TSArrayType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSConditionalType(it) => { - matches!( - other, Self::TSConditionalType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSConstructorType(it) => { - matches!( - other, Self::TSConstructorType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSFunctionType(it) => { - matches!( - other, Self::TSFunctionType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSImportType(it) => { - matches!( - other, Self::TSImportType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSIndexedAccessType(it) => { - matches!( - other, Self::TSIndexedAccessType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInferType(it) => { - matches!( - other, Self::TSInferType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSIntersectionType(it) => { - matches!( - other, Self::TSIntersectionType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSLiteralType(it) => { - matches!( - other, Self::TSLiteralType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSMappedType(it) => { - matches!( - other, Self::TSMappedType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSNamedTupleMember(it) => { - matches!( - other, Self::TSNamedTupleMember(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSQualifiedName(it) => { - matches!( - other, Self::TSQualifiedName(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTemplateLiteralType(it) => { - matches!( - other, Self::TSTemplateLiteralType(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSThisType(it) => { - matches!( - other, Self::TSThisType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTupleType(it) => { - matches!( - other, Self::TSTupleType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTypeLiteral(it) => { - matches!( - other, Self::TSTypeLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTypeOperatorType(it) => { - matches!( - other, Self::TSTypeOperatorType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypePredicate(it) => { - matches!( - other, Self::TSTypePredicate(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeQuery(it) => { - matches!( - other, Self::TSTypeQuery(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTypeReference(it) => { - matches!( - other, Self::TSTypeReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSUnionType(it) => { - matches!( - other, Self::TSUnionType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSParenthesizedType(it) => { - matches!( - other, Self::TSParenthesizedType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSDocNullableType(it) => { - matches!( - other, Self::JSDocNullableType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSDocNonNullableType(it) => { - matches!( - other, Self::JSDocNonNullableType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSDocUnknownType(it) => { - matches!( - other, Self::JSDocUnknownType(other) if ContentEq::content_eq(it, - other) - ) - } + Self::TSAnyKeyword(it) => match other { + Self::TSAnyKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSBigIntKeyword(it) => match other { + Self::TSBigIntKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSBooleanKeyword(it) => match other { + Self::TSBooleanKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIntrinsicKeyword(it) => match other { + Self::TSIntrinsicKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNeverKeyword(it) => match other { + Self::TSNeverKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNullKeyword(it) => match other { + Self::TSNullKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNumberKeyword(it) => match other { + Self::TSNumberKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSObjectKeyword(it) => match other { + Self::TSObjectKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSStringKeyword(it) => match other { + Self::TSStringKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSymbolKeyword(it) => match other { + Self::TSSymbolKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSUndefinedKeyword(it) => match other { + Self::TSUndefinedKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSUnknownKeyword(it) => match other { + Self::TSUnknownKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSVoidKeyword(it) => match other { + Self::TSVoidKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSArrayType(it) => match other { + Self::TSArrayType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSConditionalType(it) => match other { + Self::TSConditionalType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSConstructorType(it) => match other { + Self::TSConstructorType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSFunctionType(it) => match other { + Self::TSFunctionType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSImportType(it) => match other { + Self::TSImportType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIndexedAccessType(it) => match other { + Self::TSIndexedAccessType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInferType(it) => match other { + Self::TSInferType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIntersectionType(it) => match other { + Self::TSIntersectionType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSLiteralType(it) => match other { + Self::TSLiteralType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSMappedType(it) => match other { + Self::TSMappedType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNamedTupleMember(it) => match other { + Self::TSNamedTupleMember(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSQualifiedName(it) => match other { + Self::TSQualifiedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTemplateLiteralType(it) => match other { + Self::TSTemplateLiteralType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSThisType(it) => match other { + Self::TSThisType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTupleType(it) => match other { + Self::TSTupleType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeLiteral(it) => match other { + Self::TSTypeLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeOperatorType(it) => match other { + Self::TSTypeOperatorType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypePredicate(it) => match other { + Self::TSTypePredicate(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeQuery(it) => match other { + Self::TSTypeQuery(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeReference(it) => match other { + Self::TSTypeReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSUnionType(it) => match other { + Self::TSUnionType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSParenthesizedType(it) => match other { + Self::TSParenthesizedType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSDocNullableType(it) => match other { + Self::JSDocNullableType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSDocNonNullableType(it) => match other { + Self::JSDocNonNullableType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSDocUnknownType(it) => match other { + Self::JSDocUnknownType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -3877,232 +3066,166 @@ impl<'a> ContentEq for TSRestType<'a> { impl<'a> ContentEq for TSTupleElement<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::TSOptionalType(it) => { - matches!( - other, Self::TSOptionalType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSRestType(it) => { - matches!( - other, Self::TSRestType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAnyKeyword(it) => { - matches!( - other, Self::TSAnyKeyword(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSBigIntKeyword(it) => { - matches!( - other, Self::TSBigIntKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSBooleanKeyword(it) => { - matches!( - other, Self::TSBooleanKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSIntrinsicKeyword(it) => { - matches!( - other, Self::TSIntrinsicKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNeverKeyword(it) => { - matches!( - other, Self::TSNeverKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNullKeyword(it) => { - matches!( - other, Self::TSNullKeyword(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSNumberKeyword(it) => { - matches!( - other, Self::TSNumberKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSObjectKeyword(it) => { - matches!( - other, Self::TSObjectKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSStringKeyword(it) => { - matches!( - other, Self::TSStringKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSymbolKeyword(it) => { - matches!( - other, Self::TSSymbolKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSUndefinedKeyword(it) => { - matches!( - other, Self::TSUndefinedKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSUnknownKeyword(it) => { - matches!( - other, Self::TSUnknownKeyword(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSVoidKeyword(it) => { - matches!( - other, Self::TSVoidKeyword(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSArrayType(it) => { - matches!( - other, Self::TSArrayType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSConditionalType(it) => { - matches!( - other, Self::TSConditionalType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSConstructorType(it) => { - matches!( - other, Self::TSConstructorType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSFunctionType(it) => { - matches!( - other, Self::TSFunctionType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSImportType(it) => { - matches!( - other, Self::TSImportType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSIndexedAccessType(it) => { - matches!( - other, Self::TSIndexedAccessType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInferType(it) => { - matches!( - other, Self::TSInferType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSIntersectionType(it) => { - matches!( - other, Self::TSIntersectionType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSLiteralType(it) => { - matches!( - other, Self::TSLiteralType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSMappedType(it) => { - matches!( - other, Self::TSMappedType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSNamedTupleMember(it) => { - matches!( - other, Self::TSNamedTupleMember(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSQualifiedName(it) => { - matches!( - other, Self::TSQualifiedName(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTemplateLiteralType(it) => { - matches!( - other, Self::TSTemplateLiteralType(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSThisType(it) => { - matches!( - other, Self::TSThisType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTupleType(it) => { - matches!( - other, Self::TSTupleType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTypeLiteral(it) => { - matches!( - other, Self::TSTypeLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTypeOperatorType(it) => { - matches!( - other, Self::TSTypeOperatorType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypePredicate(it) => { - matches!( - other, Self::TSTypePredicate(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSTypeQuery(it) => { - matches!( - other, Self::TSTypeQuery(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSTypeReference(it) => { - matches!( - other, Self::TSTypeReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSUnionType(it) => { - matches!( - other, Self::TSUnionType(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSParenthesizedType(it) => { - matches!( - other, Self::TSParenthesizedType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSDocNullableType(it) => { - matches!( - other, Self::JSDocNullableType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSDocNonNullableType(it) => { - matches!( - other, Self::JSDocNonNullableType(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSDocUnknownType(it) => { - matches!( - other, Self::JSDocUnknownType(other) if ContentEq::content_eq(it, - other) - ) - } + Self::TSOptionalType(it) => match other { + Self::TSOptionalType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSRestType(it) => match other { + Self::TSRestType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAnyKeyword(it) => match other { + Self::TSAnyKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSBigIntKeyword(it) => match other { + Self::TSBigIntKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSBooleanKeyword(it) => match other { + Self::TSBooleanKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIntrinsicKeyword(it) => match other { + Self::TSIntrinsicKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNeverKeyword(it) => match other { + Self::TSNeverKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNullKeyword(it) => match other { + Self::TSNullKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNumberKeyword(it) => match other { + Self::TSNumberKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSObjectKeyword(it) => match other { + Self::TSObjectKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSStringKeyword(it) => match other { + Self::TSStringKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSymbolKeyword(it) => match other { + Self::TSSymbolKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSUndefinedKeyword(it) => match other { + Self::TSUndefinedKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSUnknownKeyword(it) => match other { + Self::TSUnknownKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSVoidKeyword(it) => match other { + Self::TSVoidKeyword(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSArrayType(it) => match other { + Self::TSArrayType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSConditionalType(it) => match other { + Self::TSConditionalType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSConstructorType(it) => match other { + Self::TSConstructorType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSFunctionType(it) => match other { + Self::TSFunctionType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSImportType(it) => match other { + Self::TSImportType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIndexedAccessType(it) => match other { + Self::TSIndexedAccessType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInferType(it) => match other { + Self::TSInferType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSIntersectionType(it) => match other { + Self::TSIntersectionType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSLiteralType(it) => match other { + Self::TSLiteralType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSMappedType(it) => match other { + Self::TSMappedType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNamedTupleMember(it) => match other { + Self::TSNamedTupleMember(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSQualifiedName(it) => match other { + Self::TSQualifiedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTemplateLiteralType(it) => match other { + Self::TSTemplateLiteralType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSThisType(it) => match other { + Self::TSThisType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTupleType(it) => match other { + Self::TSTupleType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeLiteral(it) => match other { + Self::TSTypeLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeOperatorType(it) => match other { + Self::TSTypeOperatorType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypePredicate(it) => match other { + Self::TSTypePredicate(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeQuery(it) => match other { + Self::TSTypeQuery(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeReference(it) => match other { + Self::TSTypeReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSUnionType(it) => match other { + Self::TSUnionType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSParenthesizedType(it) => match other { + Self::TSParenthesizedType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSDocNullableType(it) => match other { + Self::JSDocNullableType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSDocNonNullableType(it) => match other { + Self::JSDocNonNullableType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSDocUnknownType(it) => match other { + Self::JSDocUnknownType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4201,17 +3324,14 @@ impl<'a> ContentEq for TSTypeReference<'a> { impl<'a> ContentEq for TSTypeName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::IdentifierReference(it) => { - matches!( - other, Self::IdentifierReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::QualifiedName(it) => { - matches!( - other, Self::QualifiedName(other) if ContentEq::content_eq(it, other) - ) - } + Self::IdentifierReference(it) => match other { + Self::IdentifierReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::QualifiedName(it) => match other { + Self::QualifiedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4297,36 +3417,30 @@ impl<'a> ContentEq for TSPropertySignature<'a> { impl<'a> ContentEq for TSSignature<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::TSIndexSignature(it) => { - matches!( - other, Self::TSIndexSignature(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSPropertySignature(it) => { - matches!( - other, Self::TSPropertySignature(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSCallSignatureDeclaration(it) => { - matches!( - other, Self::TSCallSignatureDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSConstructSignatureDeclaration(it) => { - matches!( - other, Self::TSConstructSignatureDeclaration(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSMethodSignature(it) => { - matches!( - other, Self::TSMethodSignature(other) if ContentEq::content_eq(it, - other) - ) - } + Self::TSIndexSignature(it) => match other { + Self::TSIndexSignature(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSPropertySignature(it) => match other { + Self::TSPropertySignature(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSCallSignatureDeclaration(it) => match other { + Self::TSCallSignatureDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSConstructSignatureDeclaration(it) => match other { + Self::TSConstructSignatureDeclaration(other) + if ContentEq::content_eq(it, other) => + { + true + } + _ => false, + }, + Self::TSMethodSignature(it) => match other { + Self::TSMethodSignature(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4400,14 +3514,14 @@ impl<'a> ContentEq for TSTypePredicate<'a> { impl<'a> ContentEq for TSTypePredicateName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::This(it) => { - matches!(other, Self::This(other) if ContentEq::content_eq(it, other)) - } + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::This(it) => match other { + Self::This(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4430,16 +3544,14 @@ impl ContentEq for TSModuleDeclarationKind { impl<'a> ContentEq for TSModuleDeclarationName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4447,17 +3559,14 @@ impl<'a> ContentEq for TSModuleDeclarationName<'a> { impl<'a> ContentEq for TSModuleDeclarationBody<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::TSModuleDeclaration(it) => { - matches!( - other, Self::TSModuleDeclaration(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSModuleBlock(it) => { - matches!( - other, Self::TSModuleBlock(other) if ContentEq::content_eq(it, other) - ) - } + Self::TSModuleDeclaration(it) => match other { + Self::TSModuleDeclaration(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSModuleBlock(it) => match other { + Self::TSModuleBlock(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4491,22 +3600,18 @@ impl<'a> ContentEq for TSTypeQuery<'a> { impl<'a> ContentEq for TSTypeQueryExprName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::TSImportType(it) => { - matches!( - other, Self::TSImportType(other) if ContentEq::content_eq(it, other) - ) - } - Self::IdentifierReference(it) => { - matches!( - other, Self::IdentifierReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::QualifiedName(it) => { - matches!( - other, Self::QualifiedName(other) if ContentEq::content_eq(it, other) - ) - } + Self::TSImportType(it) => match other { + Self::TSImportType(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IdentifierReference(it) => match other { + Self::IdentifierReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::QualifiedName(it) => match other { + Self::QualifiedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4538,16 +3643,14 @@ impl<'a> ContentEq for TSImportAttribute<'a> { impl<'a> ContentEq for TSImportAttributeName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4625,23 +3728,18 @@ impl<'a> ContentEq for TSImportEqualsDeclaration<'a> { impl<'a> ContentEq for TSModuleReference<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::ExternalModuleReference(it) => { - matches!( - other, Self::ExternalModuleReference(other) if - ContentEq::content_eq(it, other) - ) - } - Self::IdentifierReference(it) => { - matches!( - other, Self::IdentifierReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::QualifiedName(it) => { - matches!( - other, Self::QualifiedName(other) if ContentEq::content_eq(it, other) - ) - } + Self::ExternalModuleReference(it) => match other { + Self::ExternalModuleReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IdentifierReference(it) => match other { + Self::IdentifierReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::QualifiedName(it) => match other { + Self::QualifiedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4755,29 +3853,22 @@ impl ContentEq for JSXClosingFragment { impl<'a> ContentEq for JSXElementName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::IdentifierReference(it) => { - matches!( - other, Self::IdentifierReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NamespacedName(it) => { - matches!( - other, Self::NamespacedName(other) if ContentEq::content_eq(it, - other) - ) - } - Self::MemberExpression(it) => { - matches!( - other, Self::MemberExpression(other) if ContentEq::content_eq(it, - other) - ) - } + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IdentifierReference(it) => match other { + Self::IdentifierReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NamespacedName(it) => match other { + Self::NamespacedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MemberExpression(it) => match other { + Self::MemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4799,18 +3890,14 @@ impl<'a> ContentEq for JSXMemberExpression<'a> { impl<'a> ContentEq for JSXMemberExpressionObject<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::IdentifierReference(it) => { - matches!( - other, Self::IdentifierReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::MemberExpression(it) => { - matches!( - other, Self::MemberExpression(other) if ContentEq::content_eq(it, - other) - ) - } + Self::IdentifierReference(it) => match other { + Self::IdentifierReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MemberExpression(it) => match other { + Self::MemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -4824,252 +3911,178 @@ impl<'a> ContentEq for JSXExpressionContainer<'a> { impl<'a> ContentEq for JSXExpression<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::EmptyExpression(it) => { - matches!( - other, Self::EmptyExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BooleanLiteral(it) => { - matches!( - other, Self::BooleanLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NullLiteral(it) => { - matches!( - other, Self::NullLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::NumericLiteral(it) => { - matches!( - other, Self::NumericLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BigIntLiteral(it) => { - matches!( - other, Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::RegExpLiteral(it) => { - matches!( - other, Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::TemplateLiteral(it) => { - matches!( - other, Self::TemplateLiteral(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::MetaProperty(it) => { - matches!( - other, Self::MetaProperty(other) if ContentEq::content_eq(it, other) - ) - } - Self::Super(it) => { - matches!(other, Self::Super(other) if ContentEq::content_eq(it, other)) - } - Self::ArrayExpression(it) => { - matches!( - other, Self::ArrayExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ArrowFunctionExpression(it) => { - matches!( - other, Self::ArrowFunctionExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::AssignmentExpression(it) => { - matches!( - other, Self::AssignmentExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::AwaitExpression(it) => { - matches!( - other, Self::AwaitExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::BinaryExpression(it) => { - matches!( - other, Self::BinaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CallExpression(it) => { - matches!( - other, Self::CallExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ChainExpression(it) => { - matches!( - other, Self::ChainExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassExpression(it) => { - matches!( - other, Self::ClassExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ConditionalExpression(it) => { - matches!( - other, Self::ConditionalExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::FunctionExpression(it) => { - matches!( - other, Self::FunctionExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ImportExpression(it) => { - matches!( - other, Self::ImportExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LogicalExpression(it) => { - matches!( - other, Self::LogicalExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NewExpression(it) => { - matches!( - other, Self::NewExpression(other) if ContentEq::content_eq(it, other) - ) - } - Self::ObjectExpression(it) => { - matches!( - other, Self::ObjectExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ParenthesizedExpression(it) => { - matches!( - other, Self::ParenthesizedExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::SequenceExpression(it) => { - matches!( - other, Self::SequenceExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TaggedTemplateExpression(it) => { - matches!( - other, Self::TaggedTemplateExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ThisExpression(it) => { - matches!( - other, Self::ThisExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnaryExpression(it) => { - matches!( - other, Self::UnaryExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UpdateExpression(it) => { - matches!( - other, Self::UpdateExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::YieldExpression(it) => { - matches!( - other, Self::YieldExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::PrivateInExpression(it) => { - matches!( - other, Self::PrivateInExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::JSXElement(it) => { - matches!( - other, Self::JSXElement(other) if ContentEq::content_eq(it, other) - ) - } - Self::JSXFragment(it) => { - matches!( - other, Self::JSXFragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::TSAsExpression(it) => { - matches!( - other, Self::TSAsExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSSatisfiesExpression(it) => { - matches!( - other, Self::TSSatisfiesExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::TSTypeAssertion(it) => { - matches!( - other, Self::TSTypeAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSNonNullExpression(it) => { - matches!( - other, Self::TSNonNullExpression(other) if ContentEq::content_eq(it, - other) - ) - } - Self::TSInstantiationExpression(it) => { - matches!( - other, Self::TSInstantiationExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::ComputedMemberExpression(it) => { - matches!( - other, Self::ComputedMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::StaticMemberExpression(it) => { - matches!( - other, Self::StaticMemberExpression(other) if - ContentEq::content_eq(it, other) - ) - } - Self::PrivateFieldExpression(it) => { - matches!( - other, Self::PrivateFieldExpression(other) if - ContentEq::content_eq(it, other) - ) - } + Self::EmptyExpression(it) => match other { + Self::EmptyExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BooleanLiteral(it) => match other { + Self::BooleanLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NullLiteral(it) => match other { + Self::NullLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NumericLiteral(it) => match other { + Self::NumericLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BigIntLiteral(it) => match other { + Self::BigIntLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::RegExpLiteral(it) => match other { + Self::RegExpLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TemplateLiteral(it) => match other { + Self::TemplateLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::MetaProperty(it) => match other { + Self::MetaProperty(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Super(it) => match other { + Self::Super(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrayExpression(it) => match other { + Self::ArrayExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ArrowFunctionExpression(it) => match other { + Self::ArrowFunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AssignmentExpression(it) => match other { + Self::AssignmentExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::AwaitExpression(it) => match other { + Self::AwaitExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::BinaryExpression(it) => match other { + Self::BinaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CallExpression(it) => match other { + Self::CallExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ChainExpression(it) => match other { + Self::ChainExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassExpression(it) => match other { + Self::ClassExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ConditionalExpression(it) => match other { + Self::ConditionalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::FunctionExpression(it) => match other { + Self::FunctionExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ImportExpression(it) => match other { + Self::ImportExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LogicalExpression(it) => match other { + Self::LogicalExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NewExpression(it) => match other { + Self::NewExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ObjectExpression(it) => match other { + Self::ObjectExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ParenthesizedExpression(it) => match other { + Self::ParenthesizedExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SequenceExpression(it) => match other { + Self::SequenceExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TaggedTemplateExpression(it) => match other { + Self::TaggedTemplateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ThisExpression(it) => match other { + Self::ThisExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnaryExpression(it) => match other { + Self::UnaryExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UpdateExpression(it) => match other { + Self::UpdateExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::YieldExpression(it) => match other { + Self::YieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateInExpression(it) => match other { + Self::PrivateInExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXElement(it) => match other { + Self::JSXElement(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::JSXFragment(it) => match other { + Self::JSXFragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSAsExpression(it) => match other { + Self::TSAsExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSSatisfiesExpression(it) => match other { + Self::TSSatisfiesExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSTypeAssertion(it) => match other { + Self::TSTypeAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSNonNullExpression(it) => match other { + Self::TSNonNullExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::TSInstantiationExpression(it) => match other { + Self::TSInstantiationExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ComputedMemberExpression(it) => match other { + Self::ComputedMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::StaticMemberExpression(it) => match other { + Self::StaticMemberExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::PrivateFieldExpression(it) => match other { + Self::PrivateFieldExpression(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -5083,17 +4096,14 @@ impl ContentEq for JSXEmptyExpression { impl<'a> ContentEq for JSXAttributeItem<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Attribute(it) => { - matches!( - other, Self::Attribute(other) if ContentEq::content_eq(it, other) - ) - } - Self::SpreadAttribute(it) => { - matches!( - other, Self::SpreadAttribute(other) if ContentEq::content_eq(it, - other) - ) - } + Self::Attribute(it) => match other { + Self::Attribute(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::SpreadAttribute(it) => match other { + Self::SpreadAttribute(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -5114,17 +4124,14 @@ impl<'a> ContentEq for JSXSpreadAttribute<'a> { impl<'a> ContentEq for JSXAttributeName<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Identifier(it) => { - matches!( - other, Self::Identifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::NamespacedName(it) => { - matches!( - other, Self::NamespacedName(other) if ContentEq::content_eq(it, - other) - ) - } + Self::Identifier(it) => match other { + Self::Identifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NamespacedName(it) => match other { + Self::NamespacedName(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -5132,25 +4139,22 @@ impl<'a> ContentEq for JSXAttributeName<'a> { impl<'a> ContentEq for JSXAttributeValue<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::StringLiteral(it) => { - matches!( - other, Self::StringLiteral(other) if ContentEq::content_eq(it, other) - ) - } - Self::ExpressionContainer(it) => { - matches!( - other, Self::ExpressionContainer(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Element(it) => { - matches!(other, Self::Element(other) if ContentEq::content_eq(it, other)) - } - Self::Fragment(it) => { - matches!( - other, Self::Fragment(other) if ContentEq::content_eq(it, other) - ) - } + Self::StringLiteral(it) => match other { + Self::StringLiteral(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExpressionContainer(it) => match other { + Self::ExpressionContainer(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Element(it) => match other { + Self::Element(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Fragment(it) => match other { + Self::Fragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -5164,26 +4168,26 @@ impl<'a> ContentEq for JSXIdentifier<'a> { impl<'a> ContentEq for JSXChild<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::Text(it) => { - matches!(other, Self::Text(other) if ContentEq::content_eq(it, other)) - } - Self::Element(it) => { - matches!(other, Self::Element(other) if ContentEq::content_eq(it, other)) - } - Self::Fragment(it) => { - matches!( - other, Self::Fragment(other) if ContentEq::content_eq(it, other) - ) - } - Self::ExpressionContainer(it) => { - matches!( - other, Self::ExpressionContainer(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Spread(it) => { - matches!(other, Self::Spread(other) if ContentEq::content_eq(it, other)) - } + Self::Text(it) => match other { + Self::Text(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Element(it) => match other { + Self::Element(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Fragment(it) => match other { + Self::Fragment(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ExpressionContainer(it) => match other { + Self::ExpressionContainer(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Spread(it) => match other { + Self::Spread(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } diff --git a/crates/oxc_regular_expression/src/generated/derive_content_eq.rs b/crates/oxc_regular_expression/src/generated/derive_content_eq.rs index f89dcafd2ea10a..1dd6c2d5cb9288 100644 --- a/crates/oxc_regular_expression/src/generated/derive_content_eq.rs +++ b/crates/oxc_regular_expression/src/generated/derive_content_eq.rs @@ -1,6 +1,8 @@ // Auto-generated code, DO NOT EDIT DIRECTLY! // To edit this generated file you have to edit `tasks/ast_tools/src/derives/content_eq.rs` +#![allow(clippy::match_like_matches_macro)] + use oxc_span::cmp::ContentEq; #[allow(clippy::wildcard_imports)] @@ -47,72 +49,54 @@ impl<'a> ContentEq for Alternative<'a> { impl<'a> ContentEq for Term<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::BoundaryAssertion(it) => { - matches!( - other, Self::BoundaryAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::LookAroundAssertion(it) => { - matches!( - other, Self::LookAroundAssertion(other) if ContentEq::content_eq(it, - other) - ) - } - Self::Quantifier(it) => { - matches!( - other, Self::Quantifier(other) if ContentEq::content_eq(it, other) - ) - } - Self::Character(it) => { - matches!( - other, Self::Character(other) if ContentEq::content_eq(it, other) - ) - } - Self::Dot(it) => { - matches!(other, Self::Dot(other) if ContentEq::content_eq(it, other)) - } - Self::CharacterClassEscape(it) => { - matches!( - other, Self::CharacterClassEscape(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnicodePropertyEscape(it) => { - matches!( - other, Self::UnicodePropertyEscape(other) if - ContentEq::content_eq(it, other) - ) - } - Self::CharacterClass(it) => { - matches!( - other, Self::CharacterClass(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CapturingGroup(it) => { - matches!( - other, Self::CapturingGroup(other) if ContentEq::content_eq(it, - other) - ) - } - Self::IgnoreGroup(it) => { - matches!( - other, Self::IgnoreGroup(other) if ContentEq::content_eq(it, other) - ) - } - Self::IndexedReference(it) => { - matches!( - other, Self::IndexedReference(other) if ContentEq::content_eq(it, - other) - ) - } - Self::NamedReference(it) => { - matches!( - other, Self::NamedReference(other) if ContentEq::content_eq(it, - other) - ) - } + Self::BoundaryAssertion(it) => match other { + Self::BoundaryAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::LookAroundAssertion(it) => match other { + Self::LookAroundAssertion(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Quantifier(it) => match other { + Self::Quantifier(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Character(it) => match other { + Self::Character(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Dot(it) => match other { + Self::Dot(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CharacterClassEscape(it) => match other { + Self::CharacterClassEscape(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnicodePropertyEscape(it) => match other { + Self::UnicodePropertyEscape(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CharacterClass(it) => match other { + Self::CharacterClass(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CapturingGroup(it) => match other { + Self::CapturingGroup(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IgnoreGroup(it) => match other { + Self::IgnoreGroup(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::IndexedReference(it) => match other { + Self::IndexedReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NamedReference(it) => match other { + Self::NamedReference(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } @@ -208,41 +192,30 @@ impl ContentEq for CharacterClassContentsKind { impl<'a> ContentEq for CharacterClassContents<'a> { fn content_eq(&self, other: &Self) -> bool { match self { - Self::CharacterClassRange(it) => { - matches!( - other, Self::CharacterClassRange(other) if ContentEq::content_eq(it, - other) - ) - } - Self::CharacterClassEscape(it) => { - matches!( - other, Self::CharacterClassEscape(other) if ContentEq::content_eq(it, - other) - ) - } - Self::UnicodePropertyEscape(it) => { - matches!( - other, Self::UnicodePropertyEscape(other) if - ContentEq::content_eq(it, other) - ) - } - Self::Character(it) => { - matches!( - other, Self::Character(other) if ContentEq::content_eq(it, other) - ) - } - Self::NestedCharacterClass(it) => { - matches!( - other, Self::NestedCharacterClass(other) if ContentEq::content_eq(it, - other) - ) - } - Self::ClassStringDisjunction(it) => { - matches!( - other, Self::ClassStringDisjunction(other) if - ContentEq::content_eq(it, other) - ) - } + Self::CharacterClassRange(it) => match other { + Self::CharacterClassRange(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::CharacterClassEscape(it) => match other { + Self::CharacterClassEscape(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::UnicodePropertyEscape(it) => match other { + Self::UnicodePropertyEscape(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::Character(it) => match other { + Self::Character(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::NestedCharacterClass(it) => match other { + Self::NestedCharacterClass(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, + Self::ClassStringDisjunction(it) => match other { + Self::ClassStringDisjunction(other) if ContentEq::content_eq(it, other) => true, + _ => false, + }, } } } diff --git a/crates/oxc_syntax/src/generated/derive_content_eq.rs b/crates/oxc_syntax/src/generated/derive_content_eq.rs index 5734981d51fab5..f3ef3fa74726bb 100644 --- a/crates/oxc_syntax/src/generated/derive_content_eq.rs +++ b/crates/oxc_syntax/src/generated/derive_content_eq.rs @@ -1,6 +1,8 @@ // Auto-generated code, DO NOT EDIT DIRECTLY! // To edit this generated file you have to edit `tasks/ast_tools/src/derives/content_eq.rs` +#![allow(clippy::match_like_matches_macro)] + use oxc_span::cmp::ContentEq; #[allow(clippy::wildcard_imports)] diff --git a/tasks/ast_tools/src/derives/content_eq.rs b/tasks/ast_tools/src/derives/content_eq.rs index a28792ed59d7bb..7ba98e13bda7c2 100644 --- a/tasks/ast_tools/src/derives/content_eq.rs +++ b/tasks/ast_tools/src/derives/content_eq.rs @@ -39,6 +39,9 @@ impl Derive for DeriveContentEq { fn prelude() -> TokenStream { quote! { + // NOTE: writing long match expressions formats better than using `matches` macro. + #![allow(clippy::match_like_matches_macro)] + ///@@line_break use oxc_span::cmp::ContentEq; } @@ -57,7 +60,11 @@ fn derive_enum(def: &EnumDef) -> (&str, TokenStream) { } else { quote! { Self :: #ident(it) => { - matches!(other, Self :: #ident (other) if ContentEq::content_eq(it, other)) + // NOTE: writing the match expression formats better than using `matches` macro. + match other { + Self :: #ident (other) if ContentEq::content_eq(it, other) => true, + _ => false, + } } } }