This commit is contained in:
LunarAkai 2025-08-05 22:02:39 +02:00
commit d7795e52f9
10 changed files with 276 additions and 31 deletions

19
src/ast/op.rs Normal file
View file

@ -0,0 +1,19 @@
#[derive(Debug, Clone)]
pub enum Op {
Add,
Subtract,
Multiply,
Divide,
}
impl Op {
pub fn eval(&self) -> String {
let text: &str = match self {
Op::Add => "+",
Op::Subtract => "-",
Op::Multiply => "*",
Op::Divide => "/",
};
text.to_string()
}
}