pub enum Expr {
Ref(String),
Range(RangeRef),
Number(f64),
Str(String),
Bool(bool),
BinaryOp {
left: Box<Expr>,
op: BinOp,
right: Box<Expr>,
},
UnaryOp {
op: UnOp,
operand: Box<Expr>,
},
Call {
name: String,
args: Vec<Expr>,
},
Name(String),
ErrorLit(ExcelError),
}Expand description
An owned Excel formula expression node.
Built by the workbook-compiler parser from CellRecord.formula; walked by
the DAG reconstructor (refs/ranges/names → dependency edges) and the
sheet_ir executor (leaf arithmetic → the pure-Rust scalar evaluator).
Variants§
Ref(String)
A single-cell reference, $-anchors already stripped (e.g. "1_Inputs!E6"
or a bare "E6"). Dependency identity does not depend on absolute vs
relative (D-07), so the parser normalizes to a plain A1/sheet!A1 string.
Range(RangeRef)
A range reference (e.g. B2:B10), reusing the structured RangeRef
(sheet stored ONCE). Expanded to per-member-cell edges by the DAG (D-06).
Number(f64)
A numeric literal.
Str(String)
A string literal (the ""-doubling already un-escaped by the lexer).
Bool(bool)
A boolean literal (TRUE/FALSE).
BinaryOp
A binary operation (left op right).
UnaryOp
A unary operation (op operand).
Call
A generic function call (D-02): name is checked against the dialect
WHITELIST at parse time; the semantics layer dispatches on it.
Fields
Name(String)
A defined-name reference (resolved against the manifest defined-names in the DAG layer, D-07).
ErrorLit(ExcelError)
A literal Excel error parsed from the formula text (e.g. #REF!),
wrapping the SHARED ExcelError (imported from crate::excel_error).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Expr
impl JsonSchema for Expr
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more