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

pub enum ExprDef {
    BinOp(BinOpBox<Expr>, Box<Expr>),
    UnaryOp(UnaryOpBox<Expr>),
    Const(Const),
    ConstDecl(Vec<(String, Expr)>),
    Construct(Box<Expr>, Vec<Expr>),
    Block(Vec<Expr>),
    Local(String),
    GetConstField(Box<Expr>, String),
    GetField(Box<Expr>, Box<Expr>),
    Call(Box<Expr>, Vec<Expr>),
    WhileLoop(Box<Expr>, Box<Expr>),
    If(Box<Expr>, Box<Expr>, Option<Box<Expr>>),
    Switch(Box<Expr>, Vec<(Expr, Vec<Expr>)>, Option<Box<Expr>>),
    ObjectDecl(Box<BTreeMap<String, Expr>>),
    ArrayDecl(Vec<Expr>),
    FunctionDecl(Option<String>, Vec<Expr>, Box<Expr>),
    ArrowFunctionDecl(Vec<Expr>, Box<Expr>),
    Return(Option<Box<Expr>>),
    Throw(Box<Expr>),
    Assign(Box<Expr>, Box<Expr>),
    VarDecl(Vec<(String, Option<Expr>)>),
    LetDecl(Vec<(String, Option<Expr>)>),
    TypeOf(Box<Expr>),
}

A Javascript Expression

Variants

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

Run a operation between 2 expressions

UnaryOp(UnaryOpBox<Expr>)

Run an operation on a value

Const(Const)

Make a constant value

ConstDecl(Vec<(String, Expr)>)

Const declaration

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

Construct an object from the function and arg{

Block(Vec<Expr>)

Run several expressions from top-to-bottom

Local(String)

Load a reference to a value, or a function argument

GetConstField(Box<Expr>, String)

Gets the constant field of a value

GetField(Box<Expr>, Box<Expr>)

Gets the field of a value

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

Call a function with some values

WhileLoop(Box<Expr>, Box<Expr>)

Repeatedly run an expression while the conditional expression resolves to true

If(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

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

Run blocks whose cases match the expression

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

Create an object out of the binary tree given

ArrayDecl(Vec<Expr>)

Create an array with items inside

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

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

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

Create an arrow function with the given arguments and expression

Return(Option<Box<Expr>>)

Return the expression from a function

Throw(Box<Expr>)

Throw a value

Assign(Box<Expr>, Box<Expr>)

Assign an expression to a value

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

{ A variable declaratio }

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

Let declaraton

TypeOf(Box<Expr>)

Return a string representing the type of the given expression

Trait Implementations

impl Clone for ExprDef[src]

impl Debug for ExprDef[src]

impl Display for ExprDef[src]

impl Drop for ExprDef[src]

impl Finalize for ExprDef[src]

impl Operator for ExprDef[src]

impl PartialEq<ExprDef> for ExprDef[src]

impl StructuralPartialEq for ExprDef[src]

impl Trace for ExprDef[src]

Auto Trait Implementations

impl RefUnwindSafe for ExprDef

impl Send for ExprDef

impl Sync for ExprDef

impl Unpin for ExprDef

impl UnwindSafe for ExprDef

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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<V, T> VZip<V> for T where
    V: MultiLane<T>,