#[derive(Debug, Clone, PartialEq)]
pub enum Expr {
Number(f64),
String(String),
Bool(bool),
Error(String),
CellRef(CellReference),
Range {
start: CellReference,
end: CellReference,
},
Function { name: String, args: Vec<Expr> },
BinaryOp {
op: BinaryOperator,
left: Box<Expr>,
right: Box<Expr>,
},
UnaryOp {
op: UnaryOperator,
operand: Box<Expr>,
},
Paren(Box<Expr>),
}
#[derive(Debug, Clone, PartialEq)]
pub struct CellReference {
pub col: String,
pub row: u32,
pub abs_col: bool,
pub abs_row: bool,
pub sheet: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BinaryOperator {
Add,
Sub,
Mul,
Div,
Pow,
Concat,
Eq,
Ne,
Lt,
Le,
Gt,
Ge,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum UnaryOperator {
Neg,
Pos,
Percent,
}