pub enum Expression {
Show 31 variants
Number(f64),
BigIntLit(String),
Str(String),
Bool(bool),
Null,
Undefined,
Identifier(String),
This,
TemplateLiteral {
quasis: Vec<String>,
exprs: Vec<Expression>,
},
TaggedTemplate {
tag: Box<Expression>,
quasis: Vec<String>,
raw: Vec<String>,
exprs: Vec<Expression>,
},
Array(Vec<Expression>),
Object(Vec<Property>),
Function {
name: Option<String>,
params: Vec<Param>,
body: Vec<Statement>,
is_arrow: bool,
is_async: bool,
is_generator: bool,
},
Await(Box<Expression>),
Yield {
argument: Option<Box<Expression>>,
delegate: bool,
},
Unary {
op: UnaryOp,
expr: Box<Expression>,
},
Update {
op: String,
prefix: bool,
target: Box<Expression>,
},
Binary {
op: BinaryOp,
left: Box<Expression>,
right: Box<Expression>,
},
Logical {
op: LogicalOp,
left: Box<Expression>,
right: Box<Expression>,
},
Assign {
op: String,
target: Box<Expression>,
value: Box<Expression>,
},
Conditional {
test: Box<Expression>,
consequent: Box<Expression>,
alternate: Box<Expression>,
},
Member {
object: Box<Expression>,
property: String,
optional: bool,
},
Index {
object: Box<Expression>,
index: Box<Expression>,
optional: bool,
},
Call {
callee: Box<Expression>,
arguments: Vec<Expression>,
optional: bool,
},
New {
callee: Box<Expression>,
arguments: Vec<Expression>,
},
Spread(Box<Expression>),
Class {
name: Option<String>,
superclass: Option<Box<Expression>>,
members: Vec<ClassMember>,
},
Super,
Sequence(Vec<Expression>),
NewTarget,
Regex(String, String),
}Variants§
Number(f64)
BigIntLit(String)
BigInt リテラル(数値部分の文字列。0x/0o/0b 接頭辞を含み得る)。
Str(String)
Bool(bool)
Null
Undefined
Identifier(String)
This
TemplateLiteral
TaggedTemplate
タグ付きテンプレート tag`...${e}...`(ES2015)。quasis/raw は
TemplateLiteral と同様 exprs より1つ多い。tag(strings, ...values) 呼出しで
strings は quasis の配列に .raw(raw の配列)を added property として持つ。
Array(Vec<Expression>)
Object(Vec<Property>)
Function
Fields
Await(Box<Expression>)
await expr。
Yield
yield expr / yield* expr。
Unary
Update
Binary
Logical
Assign
Conditional
Member
Index
Call
New
Spread(Box<Expression>)
スプレッド要素 ...expr(配列リテラル/呼出引数/オブジェクト内で展開される)。
Class
class 式/宣言。
Super
super(super(...) / super.x)。
Sequence(Vec<Expression>)
カンマ演算子 a, b, c。全要素を順に評価し、最後の値を返す
(途中の要素の副作用も実行する。for(i=0,j=10; ...) 等で使われる)。
NewTarget
new.target(MetaProperty。new 経由の呼び出しではコンストラクタ関数自身、
通常呼び出しでは undefined)。
Regex(String, String)
正規表現リテラル /pattern/flags。
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
Source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more