mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
feat(css/ast): Add missing Is
derive (#4810)
This commit is contained in:
parent
c4a6e8e4b5
commit
29884b0caf
@ -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,
|
||||
|
@ -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),
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user