pub enum Expr {
Show 17 variants
Var {
qualifier: Option<String>,
name: String,
pos: Pos,
span: Span,
},
Con {
qualifier: Option<String>,
name: String,
pos: Pos,
span: Span,
},
Lit {
kind: LitKind,
text: String,
pos: Pos,
span: Span,
},
App {
func: Box<Self>,
args: Vec<Self>,
pos: Pos,
span: Span,
},
BinOp {
op: String,
lhs: Box<Self>,
rhs: Box<Self>,
pos: Pos,
span: Span,
},
Neg {
expr: Box<Self>,
pos: Pos,
span: Span,
},
Lambda {
params: Vec<Pat>,
body: Box<Self>,
pos: Pos,
span: Span,
},
If {
cond: Box<Self>,
then_branch: Box<Self>,
else_branch: Box<Self>,
pos: Pos,
span: Span,
},
Case {
scrutinee: Box<Self>,
alts: Vec<Alt>,
pos: Pos,
span: Span,
},
Do {
stmts: Vec<DoStmt>,
pos: Pos,
span: Span,
},
LetIn {
bindings: Vec<Binding>,
body: Box<Self>,
pos: Pos,
span: Span,
},
Record {
base: Box<Self>,
fields: Vec<FieldAssign>,
pos: Pos,
span: Span,
},
Tuple {
items: Vec<Self>,
pos: Pos,
span: Span,
},
List {
items: Vec<Self>,
pos: Pos,
span: Span,
},
Try {
body: Box<Self>,
handlers: Vec<Alt>,
pos: Pos,
span: Span,
},
Section {
op: String,
operand: Option<Box<Self>>,
left: bool,
pos: Pos,
span: Span,
},
Error {
raw: String,
pos: Pos,
span: Span,
},
}Variants§
Var
Lowercase variable reference, possibly qualified.
Con
Constructor / data-constructor reference, possibly qualified.
Lit
App
Application, flattened: f a b c is one App with three args.
BinOp
Binary operator application with source-level operator text.
Neg
Unary negation.
Lambda
If
Case
Do
LetIn
Record
base with f = e, ... — record construction when base is a Con,
record update otherwise.
Tuple
List
Try
try <body> catch <alts>
Section
Right operator section like (+ 1) / left section (1 +).
Error
Expression the parser could not understand; raw text preserved so a parse failure degrades to the shim’s behavior instead of dying.
Implementations§
Source§impl Expr
impl Expr
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin 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