Enum elemental::parselet_utils::Expression
source · [−]pub enum Expression {
Assignment {
identifier: String,
value: Box<Expression>,
},
Identifier(String),
Int(i64),
Float(f64),
Matrix {
rows: usize,
cols: usize,
values: Vec<Expression>,
},
BinOp {
left: Box<Expression>,
op: String,
right: Box<Expression>,
},
Call {
name: String,
args: Vec<Expression>,
},
Nil,
}Expand description
Defines the expression types that are available in Elemental.
Variants
Assignment
Identifier(String)
Int(i64)
Float(f64)
Matrix
BinOp
Call
Nil
Implementations
sourceimpl Expression
impl Expression
sourcepub fn simplify(&self, variables: &mut HashMap<String, Expression>) -> Self
pub fn simplify(&self, variables: &mut HashMap<String, Expression>) -> Self
Simplify this expression, given a reference to a list of variables.
Trait Implementations
sourceimpl Clone for Expression
impl Clone for Expression
sourcefn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for Expression
impl Debug for Expression
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more