feat(css/ast): Add missing Is derive (#4810)

This commit is contained in:
Pig Fang 2022-05-27 14:22:36 +08:00 committed by GitHub
parent c4a6e8e4b5
commit 29884b0caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 8 deletions

View File

@ -332,7 +332,7 @@ pub struct MediaFeatureBoolean {
pub name: MediaFeatureName,
}
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)]
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, Is, EqIgnoreSpan)]
pub enum MediaFeatureRangeComparison {
/// `<`
Lt,

View File

@ -158,7 +158,7 @@ pub struct Declaration {
}
#[ast_node]
#[derive(Eq, Hash, EqIgnoreSpan)]
#[derive(Eq, Hash, Is, EqIgnoreSpan)]
pub enum DeclarationName {
#[tag("Ident")]
Ident(Ident),

View File

@ -68,7 +68,7 @@ pub struct Combinator {
pub value: CombinatorValue,
}
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)]
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, Is, EqIgnoreSpan)]
pub enum CombinatorValue {
/// ` `
Descendant,
@ -175,7 +175,7 @@ pub struct AttributeSelector {
pub modifier: Option<AttributeSelectorModifier>,
}
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)]
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, Is, EqIgnoreSpan)]
pub enum AttributeSelectorMatcherValue {
/// `=`
Equals,

View File

@ -3,6 +3,7 @@ use std::{
mem,
};
use is_macro::Is;
use serde::{Deserialize, Serialize};
use swc_atoms::JsWord;
use swc_common::{ast_node, EqIgnoreSpan, Span};
@ -21,7 +22,7 @@ pub struct TokenAndSpan {
pub token: Token,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, EqIgnoreSpan)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Is, EqIgnoreSpan)]
pub enum NumberType {
#[serde(rename = "integer")]
Integer,

View File

@ -81,7 +81,7 @@ impl EqIgnoreSpan for Str {
}
}
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)]
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, Is, EqIgnoreSpan)]
pub enum DelimiterValue {
/// `,`
Comma,
@ -311,7 +311,7 @@ pub struct Ratio {
pub right: Option<Number>,
}
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)]
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, Is, EqIgnoreSpan)]
pub enum BinOp {
/// `+`
Add,
@ -399,7 +399,7 @@ pub struct CalcOperator {
pub value: CalcOperatorType,
}
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, EqIgnoreSpan)]
#[derive(StringEnum, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash, Is, EqIgnoreSpan)]
pub enum CalcOperatorType {
/// `+`
Add,