Module reference

Module reference 

Source
Expand description

Cell, coordinate, and range reference utilities for a spreadsheet engine.

§Design goals

  • Compact: small, Copy‑able types (12–16 bytes) that can be placed in large dependency graphs without GC/heap pressure.
  • Excel‑compatible semantics: four anchoring modes (A1, $A1, A$1, $A$1) plus optional sheet scoping.
  • Utility helpers: rebasing, offsetting, (de)serialising, and pretty Display.

┌──────────┐    1) Parser/loader creates         ┌─────────────┐
│  Coord   │────┐                                 │   CellRef   │
└──────────┘    └──────┐      2) Linker inserts ─▶└─────────────┘
 row, col, flags        │      SheetId + range
                        ▼
               ┌────────────────┐   (RangeRef = 2×CellRef)
               │ Evaluation IR  │  (row/col absolute, flags dropped)
               └────────────────┘

Structs§

CellRef
Coord
One 2‑D grid coordinate (row, column) plus absolute/relative flags.
RangeRef

Functions§

combine_references
Combine two references with the range operator ‘:’ Supports combining Cell:Cell, Cell:Range (and Range:Cell), and Range:Range on the same sheet. Returns #REF! for cross-sheet combinations or incompatible shapes.

Type Aliases§

SheetId
Sheet identifier inside a workbook.