Enum boa::syntax::ast::expr::ExprDef

source ·
pub enum ExprDef {
Show 21 variants BinOpExpr(BinOpBox<Expr>, Box<Expr>), UnaryOpExpr(UnaryOpBox<Expr>), ConstExpr(Const), ConstructExpr(Box<Expr>, Vec<Expr>), BlockExpr(Vec<Expr>), LocalExpr(String), GetConstFieldExpr(Box<Expr>, String), GetFieldExpr(Box<Expr>, Box<Expr>), CallExpr(Box<Expr>, Vec<Expr>), WhileLoopExpr(Box<Expr>, Box<Expr>), IfExpr(Box<Expr>, Box<Expr>, Option<Box<Expr>>), SwitchExpr(Box<Expr>, Vec<(Expr, Vec<Expr>)>, Option<Box<Expr>>), ObjectDeclExpr(Box<BTreeMap<String, Expr>>), ArrayDeclExpr(Vec<Expr>), FunctionDeclExpr(Option<String>, Vec<String>, Box<Expr>), ArrowFunctionDeclExpr(Vec<String>, Box<Expr>), ReturnExpr(Option<Box<Expr>>), ThrowExpr(Box<Expr>), AssignExpr(Box<Expr>, Box<Expr>), VarDeclExpr(Vec<(String, Option<Expr>)>), TypeOfExpr(Box<Expr>),
}
Expand description

A Javascript Expression

Variants

BinOpExpr(BinOpBox<Expr>, Box<Expr>)

Run a operation between 2 expressions

UnaryOpExpr(UnaryOpBox<Expr>)

Run an operation on a value

ConstExpr(Const)

Make a constant value

ConstructExpr(Box<Expr>, Vec<Expr>)

Construct an object from the function and arg{ uments given },

BlockExpr(Vec<Expr>)

Run several expressions from top-to-bottom

LocalExpr(String)

Load a reference to a value

GetConstFieldExpr(Box<Expr>, String)

Gets the constant field of a value

GetFieldExpr(Box<Expr>, Box<Expr>)

Gets the field of a value

CallExpr(Box<Expr>, Vec<Expr>)

Call a function with some values

WhileLoopExpr(Box<Expr>, Box<Expr>)

Repeatedly run an expression while the conditional expression resolves to true

IfExpr(Box<Expr>, Box<Expr>, Option<Box<Expr>>)

Check if a conditional expression is true and run an expression if it is and another expression if it isn’t

SwitchExpr(Box<Expr>, Vec<(Expr, Vec<Expr>)>, Option<Box<Expr>>)

Run blocks whose cases match the expression

ObjectDeclExpr(Box<BTreeMap<String, Expr>>)

Create an object out of the binary tree given

ArrayDeclExpr(Vec<Expr>)

Create an array with items inside

FunctionDeclExpr(Option<String>, Vec<String>, Box<Expr>)

Create a function with the given name, arguments, and expression

ArrowFunctionDeclExpr(Vec<String>, Box<Expr>)

Create an arrow function with the given arguments and expression

ReturnExpr(Option<Box<Expr>>)

Return the expression from a function

ThrowExpr(Box<Expr>)

Throw a value

AssignExpr(Box<Expr>, Box<Expr>)

Assign an expression to a value

VarDeclExpr(Vec<(String, Option<Expr>)>)

{ A variable declaratio }

TypeOfExpr(Box<Expr>)

Return a string representing the type of the given expression

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
Get the associativity as a boolean that is true if it goes rightwards
Get the precedence as an unsigned integer, where the lower it is, the more precedence/priority it has
Get the precedence and associativity of this operator
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Marks all contained Gcs.
Increments the root-count of all contained Gcs.
Decrements the root-count of all contained Gcs.
Runs Finalize::finalize() on this object and all contained subobjects Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.