Expand description
Formula evaluation engine.
Evaluates parsed formula ASTs against cell data provided through the
CellDataProvider trait. Supports arithmetic, comparison, string
concatenation, cell/range references, and built-in function calls.
Structs§
- Cell
Coord - A cell coordinate used as a node in the dependency graph.
- Cell
Snapshot - In-memory snapshot of cell data, decoupled from any Workbook borrow.
- Evaluator
- Stateful evaluator that tracks recursion depth and circular references.
Traits§
- Cell
Data Provider - Provides cell data for formula evaluation.
Functions§
- build_
dependency_ graph - Build a dependency graph from formula cells. Returns a map from each formula cell to the cells it depends on.
- coerce_
to_ bool - Coerce a CellValue to a boolean. Numbers: 0 is false, nonzero is true. Strings “TRUE”/“FALSE” are recognized. Empty is false.
- coerce_
to_ number - Coerce a CellValue to f64. Booleans become 0/1, empty becomes 0, numeric strings are parsed. Non-numeric strings yield an error.
- coerce_
to_ string - Coerce a CellValue to a string.
- compare_
values - Compare two CellValues for ordering. Uses Excel comparison semantics: numbers compare numerically, strings compare case-insensitively, mixed types rank as: empty < number < string < bool.
- evaluate
- Evaluate a parsed formula expression against the given cell data provider.
- topological_
sort - Topological sort of formula cells based on dependencies. Returns cells in evaluation order (dependencies first). Detects cycles and returns an error if found.