feat(eval): add extremely basic evaluation

added a basic `eval_expr` function that evaluates an expression.
it still does not reduce/simplify anything, and it cannot evaluate to fractions yet
This commit is contained in:
ozzy committed 2026-09-26 14:51:33 -05:00
1 parent b68b1db2f6
commit 234b2ef2dc
4 files changed
+44 -2

No files matched your search

+5
View File
@@ -1,6 +1,7 @@
use crate::math::types::Expression;
mod display;
mod eval;
mod lexer;
mod parser;
@@ -11,3 +12,7 @@ pub fn parse(source: &str) -> Expression {
let mut parser = parser::from(lexer.collect());
parser.parse()
}
pub fn eval(expr: Expression) -> Expression {
eval::eval_expr(expr)
}