vimsheet.formula.evaluator
Formula evaluator — walks the AST and resolves values.
- exception vimsheet.formula.evaluator.EvalError(sentinel)[source]
Bases:
ExceptionInternal error raised during evaluation; converted to a sentinel string.
- Parameters:
sentinel (str)
- Return type:
None
- class vimsheet.formula.evaluator.Evaluator(sheet, workbook=None)[source]
Bases:
objectEvaluate a formula AST in the context of a Sheet.
Usage:
ev = Evaluator(sheet) result = ev.eval_formula("=SUM(A1:A5)")
- Parameters:
sheet (Sheet)
workbook (Any | None)
- __init__(sheet, workbook=None)[source]
- Parameters:
sheet (Sheet)
workbook (Any | None)
- Return type:
None
- vimsheet.formula.evaluator.recalculate(sheet, graph)[source]
Recalculate all formula cells in sheet using graph for ordering.
Updates each cell’s
valueanddisplayin topological order. Cells in a cycle receive#CIRC.- Parameters:
sheet (Sheet)
graph (DependencyGraph)
- Return type:
None