pub enum ExprKind<'src> {
Literal(Number),
Ident {
name: &'src str,
},
Unary {
op: UnOp,
expr: Box<Expr<'src>>,
},
Binary {
op: BinOp,
left: Box<Expr<'src>>,
right: Box<Expr<'src>>,
},
Call {
name: &'src str,
args: Vec<Expr<'src>>,
},
If {
cond: Box<Expr<'src>>,
then_branch: Box<Expr<'src>>,
else_branch: Box<Expr<'src>>,
},
Let {
decls: Vec<(&'src str, Expr<'src>)>,
body: Box<Expr<'src>>,
},
}Expand description
Expression kind representing different types of expressions.
Variants§
Literal(Number)
Numeric literal
Ident
Identifier (constant or variable)
Unary
Unary operation
Binary
Binary operation
Call
Function call
If
Conditional expression
Let
Let expression with local constant declarations
Trait Implementations§
Auto Trait Implementations§
impl<'src> Freeze for ExprKind<'src>
impl<'src> RefUnwindSafe for ExprKind<'src>
impl<'src> Send for ExprKind<'src>
impl<'src> Sync for ExprKind<'src>
impl<'src> Unpin for ExprKind<'src>
impl<'src> UnwindSafe for ExprKind<'src>
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