[][src]Enum boa::syntax::ast::expr::ExprDef

pub enum ExprDef {
    BinOpExpr(BinOpBox<Expr>, Box<Expr>),
    UnaryOpExpr(UnaryOpBox<Expr>),
    ConstExpr(Const),
    ConstDeclExpr(Vec<(String, Option<Expr>)>),
    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>)>),
    LetDeclExpr(Vec<(String, Option<Expr>)>),
    TypeOfExpr(Box<Expr>),
}

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

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

Const declaration

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

Construct an object from the function and arg{

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 }

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

Let declaraton

TypeOfExpr(Box<Expr>)

Return a string representing the type of the given expression

Trait Implementations

impl Operator for ExprDef[src]

fn get_precedence_and_assoc(&self) -> (u64, bool)[src]

Get the precedence and associativity of this operator

impl PartialEq<ExprDef> for ExprDef[src]

impl Drop for ExprDef[src]

impl Clone for ExprDef[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ExprDef[src]

impl Display for ExprDef[src]

impl Finalize for ExprDef[src]

fn finalize(&self)[src]

impl Trace for ExprDef[src]

Auto Trait Implementations

impl Send for ExprDef

impl Sync for ExprDef

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]