pub enum Expr {
Number(f64),
Add(Box<Expr>, Box<Expr>),
Sub(Box<Expr>, Box<Expr>),
Variable(String),
}
Expand description
Abstract Syntax Tree (AST) module.
This module defines the data structures used to represent parsed expressions and statements in the interpreter. Represents an expression in the language.
Variants§
Number(f64)
A literal number.
Add(Box<Expr>, Box<Expr>)
Addition of two expressions.
Sub(Box<Expr>, Box<Expr>)
Subtraction of two expressions.
Variable(String)
A variable reference.
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 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