pub enum Expr {
IntLit(i64, SourceLoc),
BoolLit(bool, SourceLoc),
StringLit(String, SourceLoc),
WordCall(String, SourceLoc),
Quotation(Vec<Expr>, SourceLoc),
Match {
branches: Vec<MatchBranch>,
loc: SourceLoc,
},
If {
then_branch: Box<Expr>,
else_branch: Box<Expr>,
loc: SourceLoc,
},
}Expand description
Expression in the body of a word
Variants§
IntLit(i64, SourceLoc)
Literal integer
BoolLit(bool, SourceLoc)
Literal boolean
StringLit(String, SourceLoc)
Literal string
WordCall(String, SourceLoc)
Word call (reference to another word)
Quotation(Vec<Expr>, SourceLoc)
Quotation (code block)
Match
Pattern match expression
If
If expression (condition is top of stack)
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 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