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

Fields

identifier: String
value: Box<Expression>

Identifier(String)

Int(i64)

Float(f64)

Matrix

Fields

rows: usize
cols: usize
values: Vec<Expression>

BinOp

Fields

left: Box<Expression>
op: String
right: Box<Expression>

Call

Fields

name: String
args: Vec<Expression>

Nil

Implementations

Simplify this expression, given a reference to a list of variables.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Implementing std::fmt::Display allows us to print expressions using the default formatter.

Display each Expression.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.