use crate::token::Literal; /// Binary Operator Types. For operations that have two operands #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum BinOpType { Add, Sub, Mul, Div, Mod } /// Unary Operator Types. For operations that have one operand #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum UnOpType { Neg } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct FnCall { pub fn_name: String, pub args: Vec, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Expr { Literal(Literal), // contains variable name Variable(String), FnCall(FnCall), BinOp(BinOpType, Box, Box), UnOp(UnOpType, Box), } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Statement { Expr(Expr), LetBinding(String, Expr), Assignment(String, Expr), }