pub enum Expr {
Term {
sym: Ident,
args: Vec<Expr>,
pos: Pos,
},
Var {
name: Ident,
pos: Pos,
},
ConstInt {
val: i128,
pos: Pos,
},
ConstPrim {
val: Ident,
pos: Pos,
},
Let {
defs: Vec<LetDef>,
body: Box<Expr>,
pos: Pos,
},
}
Expand description
An expression: the right-hand side of a rule.
Note that this almost looks like a core Lisp or lambda calculus, except that there is no abstraction (lambda). This first-order limit is what makes it analyzable.
Variants§
Term
A term: (sym args...)
.
Var
A variable use.
ConstInt
A constant integer.
ConstPrim
A constant of some other primitive type.
Let
The (let ((var ty val)*) body)
form.
Implementations§
Trait Implementations§
impl Eq for Expr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)