formualizer_eval/engine/
named_range.rs1use formualizer_parse::{ASTNode, parser::ReferenceType};
2use rustc_hash::FxHashSet;
3
4use crate::{CellRef, RangeRef, SheetId, engine::VertexId};
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8pub enum NameScope {
9 Workbook,
11 Sheet(SheetId),
13}
14
15#[derive(Debug, Clone, PartialEq)]
17pub enum NamedDefinition {
18 Cell(CellRef),
20 Range(RangeRef),
22 Formula {
24 ast: ASTNode,
25 dependencies: Vec<VertexId>,
27 range_deps: Vec<ReferenceType>,
29 },
30}
31
32#[derive(Debug, Clone)]
34pub struct NamedRange {
35 pub definition: NamedDefinition,
36 pub scope: NameScope,
37 pub dependents: FxHashSet<VertexId>,
39}