Enum js::syntax::ast::expr::ExprDef[src]
pub enum ExprDef {
BinOpExpr(BinOp, Box<Expr>, Box<Expr>),
UnaryOpExpr(UnaryOp, Box<Expr>),
ConstExpr(Const),
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<TreeMap<String, Expr>>),
ArrayDeclExpr(Vec<Expr>),
FunctionDeclExpr(Option<String>, Vec<String>, Box<Expr>),
ArrowFunctionDeclExpr(Vec<String>, Box<Expr>),
ConstructExpr(Box<Expr>, Vec<Expr>),
ReturnExpr(Option<Box<Expr>>),
ThrowExpr(Box<Expr>),
AssignExpr(Box<Expr>, Box<Expr>),
VarDeclExpr(Vec<(String, Option<Expr>)>),
TypeOfExpr(Box<Expr>),
}A Javascript expression
Variants
BinOpExpr | Run a operation between 2 expressions |
UnaryOpExpr | Run an operation on a value |
ConstExpr | Make a constant value |
BlockExpr | Run several expressions from top-to-bottom |
LocalExpr | Load a reference to a value |
GetConstFieldExpr | Gets the constant field of a value |
GetFieldExpr | Gets the field of a value |
CallExpr | Call a function with some values |
WhileLoopExpr | Repeatedly run an expression while the conditional expression resolves to true |
IfExpr | Check if a conditional expression is true and run an expression if it is and another expression if it isn't |
SwitchExpr | Run blocks whose cases match the expression |
ObjectDeclExpr | Create an object out of the binary tree given |
ArrayDeclExpr | Create an array with items inside |
FunctionDeclExpr | Create a function with the given name, arguments, and expression |
ArrowFunctionDeclExpr | Create an arrow function with the given arguments and expression |
ConstructExpr | Construct an object from the function and arguments given |
ReturnExpr | Return the expression from a function |
ThrowExpr | Throw a value |
AssignExpr | Assign an expression to a value |
VarDeclExpr | A variable declaration |
TypeOfExpr | Return a string representing the type of the given expression |