pub enum Expr {
Show 14 variants
Number(f64),
BigInteger(String),
String(String),
Boolean(bool),
Null,
Identifier(String),
Binary {
left: Box<Expr>,
op: BinOp,
right: Box<Expr>,
},
Unary {
op: UnaryOp,
expr: Box<Expr>,
},
Call {
func: Box<Expr>,
args: Vec<Expr>,
},
Array(Vec<Expr>),
Dict(Vec<(String, Expr)>),
Index {
object: Box<Expr>,
index: Box<Expr>,
},
If {
condition: Box<Expr>,
then_branch: Vec<Stmt>,
elif_branches: Vec<(Expr, Vec<Stmt>)>,
else_branch: Option<Vec<Stmt>>,
},
Lambda {
params: Vec<String>,
body: Vec<Stmt>,
},
}Expand description
Expressions - things that evaluate to values
Variants§
Number(f64)
BigInteger(String)
String(String)
Boolean(bool)
Null
Identifier(String)
Binary
Unary
Call
Array(Vec<Expr>)
Dict(Vec<(String, Expr)>)
Index
If
Fields
Lambda
Implementations§
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
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