Enum swc_ecma_ast::Expr
source · [−]pub enum Expr {
Show 36 variants
This(ThisExpr),
Array(ArrayLit),
Object(ObjectLit),
Fn(FnExpr),
Unary(UnaryExpr),
Update(UpdateExpr),
Bin(BinExpr),
Assign(AssignExpr),
Member(MemberExpr),
SuperProp(SuperPropExpr),
Cond(CondExpr),
Call(CallExpr),
New(NewExpr),
Seq(SeqExpr),
Ident(Ident),
Lit(Lit),
Tpl(Tpl),
TaggedTpl(TaggedTpl),
Arrow(ArrowExpr),
Class(ClassExpr),
Yield(YieldExpr),
MetaProp(MetaPropExpr),
Await(AwaitExpr),
Paren(ParenExpr),
JSXMember(JSXMemberExpr),
JSXNamespacedName(JSXNamespacedName),
JSXEmpty(JSXEmptyExpr),
JSXElement(Box<JSXElement>),
JSXFragment(JSXFragment),
TsTypeAssertion(TsTypeAssertion),
TsConstAssertion(TsConstAssertion),
TsNonNull(TsNonNullExpr),
TsAs(TsAsExpr),
PrivateName(PrivateName),
OptChain(OptChainExpr),
Invalid(Invalid),
}
Variants
This(ThisExpr)
Array(ArrayLit)
Object(ObjectLit)
Fn(FnExpr)
Unary(UnaryExpr)
Update(UpdateExpr)
++v
, --v
, v++
, v--
Bin(BinExpr)
Assign(AssignExpr)
Member(MemberExpr)
A member expression. If computed is true, the node corresponds to a computed (a[b]) member expression and property is an Expression. If computed is false, the node corresponds to a static (a.b) member expression and property is an Identifier.
SuperProp(SuperPropExpr)
Cond(CondExpr)
true ? ‘a’ : ‘b’
Call(CallExpr)
New(NewExpr)
new Cat()
Seq(SeqExpr)
Ident(Ident)
Lit(Lit)
Tpl(Tpl)
TaggedTpl(TaggedTpl)
Arrow(ArrowExpr)
Class(ClassExpr)
Yield(YieldExpr)
MetaProp(MetaPropExpr)
Await(AwaitExpr)
Paren(ParenExpr)
JSXMember(JSXMemberExpr)
JSXNamespacedName(JSXNamespacedName)
JSXEmpty(JSXEmptyExpr)
JSXElement(Box<JSXElement>)
JSXFragment(JSXFragment)
TsTypeAssertion(TsTypeAssertion)
TsConstAssertion(TsConstAssertion)
TsNonNull(TsNonNullExpr)
TsAs(TsAsExpr)
PrivateName(PrivateName)
OptChain(OptChainExpr)
Invalid(Invalid)
Implementations
Returns Some
if self
is a reference of variant This
, and None
otherwise.
Returns Some
if self
is of variant This
, and None
otherwise.
Returns Some
if self
is a reference of variant Array
, and None
otherwise.
Returns Some
if self
is of variant Array
, and None
otherwise.
Returns Some
if self
is a reference of variant Object
, and None
otherwise.
Returns Some
if self
is of variant Object
, and None
otherwise.
Returns true
if self
is of variant Fn
.
Returns Some
if self
is a reference of variant Fn
, and None
otherwise.
Returns Some
if self
is of variant Fn
, and None
otherwise.
Returns Some
if self
is a reference of variant Unary
, and None
otherwise.
Returns Some
if self
is of variant Unary
, and None
otherwise.
Returns Some
if self
is a reference of variant Update
, and None
otherwise.
Returns Some
if self
is of variant Update
, and None
otherwise.
Returns Some
if self
is a reference of variant Bin
, and None
otherwise.
Returns Some
if self
is of variant Bin
, and None
otherwise.
Returns Some
if self
is a reference of variant Assign
, and None
otherwise.
Returns Some
if self
is of variant Assign
, and None
otherwise.
Returns Some
if self
is a reference of variant Member
, and None
otherwise.
Returns Some
if self
is of variant Member
, and None
otherwise.
Returns true
if self
is of variant SuperProp
.
Returns Some
if self
is a reference of variant SuperProp
, and None
otherwise.
Returns Some
if self
is of variant SuperProp
, and None
otherwise.
Returns Some
if self
is a reference of variant Cond
, and None
otherwise.
Returns Some
if self
is of variant Cond
, and None
otherwise.
Returns Some
if self
is a reference of variant Call
, and None
otherwise.
Returns Some
if self
is of variant Call
, and None
otherwise.
Returns Some
if self
is a reference of variant New
, and None
otherwise.
Returns Some
if self
is of variant New
, and None
otherwise.
Returns Some
if self
is a reference of variant Seq
, and None
otherwise.
Returns Some
if self
is of variant Seq
, and None
otherwise.
Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
Returns Some
if self
is of variant Ident
, and None
otherwise.
Returns Some
if self
is a reference of variant Lit
, and None
otherwise.
Returns Some
if self
is a reference of variant Tpl
, and None
otherwise.
Returns true
if self
is of variant TaggedTpl
.
Returns Some
if self
is a reference of variant TaggedTpl
, and None
otherwise.
Returns Some
if self
is of variant TaggedTpl
, and None
otherwise.
Returns Some
if self
is a reference of variant Arrow
, and None
otherwise.
Returns Some
if self
is of variant Arrow
, and None
otherwise.
Returns Some
if self
is a reference of variant Class
, and None
otherwise.
Returns Some
if self
is of variant Class
, and None
otherwise.
Returns true
if self
is of variant Yield
.
Returns Some
if self
is a reference of variant Yield
, and None
otherwise.
Returns Some
if self
is of variant Yield
, and None
otherwise.
Returns true
if self
is of variant MetaProp
.
Returns Some
if self
is a reference of variant MetaProp
, and None
otherwise.
Returns Some
if self
is of variant MetaProp
, and None
otherwise.
Returns true
if self
is of variant Await
.
Returns Some
if self
is a reference of variant Await
, and None
otherwise.
Returns Some
if self
is of variant Await
, and None
otherwise.
Returns Some
if self
is a reference of variant Paren
, and None
otherwise.
Returns Some
if self
is of variant Paren
, and None
otherwise.
Returns true
if self
is of variant JSXMember
.
Returns Some
if self
is a reference of variant JSXMember
, and None
otherwise.
Returns Some
if self
is of variant JSXMember
, and None
otherwise.
Returns true
if self
is of variant JSXNamespacedName
.
Returns Some
if self
is a reference of variant JSXNamespacedName
, and None
otherwise.
Unwraps the value, yielding the content of JSXNamespacedName
.
Panics
Panics if the value is not JSXNamespacedName
, with a panic message including the content of self
.
Returns Some
if self
is of variant JSXNamespacedName
, and None
otherwise.
Returns true
if self
is of variant JSXEmpty
.
Returns Some
if self
is a reference of variant JSXEmpty
, and None
otherwise.
Returns Some
if self
is of variant JSXEmpty
, and None
otherwise.
Returns true
if self
is of variant JSXElement
.
Returns Some
if self
is a reference of variant JSXElement
, and None
otherwise.
Unwraps the value, yielding the content of JSXElement
.
Panics
Panics if the value is not JSXElement
, with a panic message including the content of self
.
Returns Some
if self
is of variant JSXElement
, and None
otherwise.
Returns true
if self
is of variant JSXFragment
.
Returns Some
if self
is a reference of variant JSXFragment
, and None
otherwise.
Unwraps the value, yielding the content of JSXFragment
.
Panics
Panics if the value is not JSXFragment
, with a panic message including the content of self
.
Returns Some
if self
is of variant JSXFragment
, and None
otherwise.
Returns true
if self
is of variant TsTypeAssertion
.
Returns Some
if self
is a reference of variant TsTypeAssertion
, and None
otherwise.
Unwraps the value, yielding the content of TsTypeAssertion
.
Panics
Panics if the value is not TsTypeAssertion
, with a panic message including the content of self
.
Returns Some
if self
is of variant TsTypeAssertion
, and None
otherwise.
Returns true
if self
is of variant TsConstAssertion
.
Returns Some
if self
is a reference of variant TsConstAssertion
, and None
otherwise.
Unwraps the value, yielding the content of TsConstAssertion
.
Panics
Panics if the value is not TsConstAssertion
, with a panic message including the content of self
.
Returns Some
if self
is of variant TsConstAssertion
, and None
otherwise.
Returns true
if self
is of variant TsNonNull
.
Returns Some
if self
is a reference of variant TsNonNull
, and None
otherwise.
Returns Some
if self
is of variant TsNonNull
, and None
otherwise.
Returns Some
if self
is a reference of variant TsAs
, and None
otherwise.
Returns Some
if self
is of variant TsAs
, and None
otherwise.
Returns true
if self
is of variant PrivateName
.
Returns Some
if self
is a reference of variant PrivateName
, and None
otherwise.
Unwraps the value, yielding the content of PrivateName
.
Panics
Panics if the value is not PrivateName
, with a panic message including the content of self
.
Returns Some
if self
is of variant PrivateName
, and None
otherwise.
Returns true
if self
is of variant OptChain
.
Returns Some
if self
is a reference of variant OptChain
, and None
otherwise.
Returns Some
if self
is of variant OptChain
, and None
otherwise.
Returns true
if self
is of variant Invalid
.
Returns Some
if self
is a reference of variant Invalid
, and None
otherwise.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Expr
impl UnwindSafe for Expr
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
The archived counterpart of this type. Unlike Archive
, it may be unsized. Read more
type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
pub unsafe fn resolve_metadata(
&self,
usize,
<T as ArchiveUnsized>::MetadataResolver,
*mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
pub unsafe fn resolve_metadata(
&self,
usize,
<T as ArchiveUnsized>::MetadataResolver,
*mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more