pub enum ExprKind {
Show 22 variants
Literal(Literal),
Identifier(String),
Binary {
left: Box<Expr>,
op: BinaryOp,
right: Box<Expr>,
},
Unary {
op: UnaryOp,
operand: Box<Expr>,
},
Call {
callee: Box<Expr>,
args: Vec<Expr>,
},
MethodCall {
receiver: Box<Expr>,
method: String,
type_args: Option<Vec<Type>>,
args: Vec<Expr>,
},
FieldAccess {
object: Box<Expr>,
field: String,
},
Index {
object: Box<Expr>,
index: Box<Expr>,
},
Array(Vec<Expr>),
Map(Vec<(Expr, Expr)>),
Tuple(Vec<Expr>),
StructLiteral {
name: String,
fields: Vec<StructLiteralField>,
},
EnumConstructor {
enum_name: String,
variant: String,
args: Vec<Expr>,
},
Lambda {
params: Vec<(String, Option<Type>)>,
return_type: Option<Type>,
body: Box<Expr>,
},
Paren(Box<Expr>),
Cast {
expr: Box<Expr>,
target_type: Type,
},
TypeCheck {
expr: Box<Expr>,
check_type: Type,
},
IsPattern {
expr: Box<Expr>,
pattern: Pattern,
},
If {
condition: Box<Expr>,
then_branch: Box<Expr>,
else_branch: Option<Box<Expr>>,
},
Block(Vec<Stmt>),
Return(Vec<Expr>),
Range {
start: Box<Expr>,
end: Box<Expr>,
inclusive: bool,
},
}Variants§
Literal(Literal)
Identifier(String)
Binary
Unary
Call
MethodCall
FieldAccess
Index
Array(Vec<Expr>)
Map(Vec<(Expr, Expr)>)
Tuple(Vec<Expr>)
StructLiteral
EnumConstructor
Lambda
Paren(Box<Expr>)
Cast
TypeCheck
IsPattern
If
Block(Vec<Stmt>)
Return(Vec<Expr>)
Range
Trait Implementations§
impl StructuralPartialEq for ExprKind
Auto Trait Implementations§
impl Freeze for ExprKind
impl RefUnwindSafe for ExprKind
impl Send for ExprKind
impl Sync for ExprKind
impl Unpin for ExprKind
impl UnwindSafe for ExprKind
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