math-ast 0.2.0

mast ast for basic arithmetic operations
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![feature(box_syntax)]

pub mod traits;
mod utils;

#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub enum AST<T> {
    Number(T),
    Factorial(Box<AST<T>>),
    Plus(Box<AST<T>>, Box<AST<T>>),
    Minus(Box<AST<T>>, Box<AST<T>>),
    Times(Box<AST<T>>, Box<AST<T>>),
    Divide(Box<AST<T>>, Box<AST<T>>),
    Power(Box<AST<T>>, Box<AST<T>>),
    Surd(Box<AST<T>>, Box<AST<T>>),
    Connect(Box<AST<T>>, Box<AST<T>>),
}