pub struct RefExpr {
pub sheet: Option<String>,
pub last_sheet: Option<String>,
pub top: u32,
pub left: u32,
pub bottom: u32,
pub right: u32,
pub written: String,
pub shape: Shape,
pub corners: Corners,
pub found: Option<(u8, u8)>,
}Expand description
One reference as the parser hands it to the evaluator: a rectangle on one sheet, or the same rectangle on every sheet of a span.
Fields§
§sheet: Option<String>The sheet named in front of !, or None for the formula’s own.
last_sheet: Option<String>The last sheet of a 3D span, Jan:Dec!A1.
top: u32§left: u32§bottom: u32§right: u32§written: StringThe reference as written, for a label.
shape: ShapeThe reference’s part as the scanner read it (a cell, a range, a
whole column or row) and its corners as written with their $
marks, which a move at an offset reads (KERNEL.22): the rectangle
above is these corners sorted.
corners: Corners§found: Option<(u8, u8)>The sheets named in front of !, the first and the last, found once
against the grid an engine’s machine placed the formula in
(KERNEL.20), whose sheets are fixed for its life. None for a
reference to the formula’s own sheet, for a sheet the grid does not
hold, for one past the 256th, and for any parse not placed, each of
which finds its sheets by name at every evaluation, as before. A byte
each, so that the field fits the padding the struct already had: a
parse’s size is what VLA.1’s limits are pinned on, a stack of 1 MiB,
and the reference is the largest kind of expression (measured: two
words would have made every expression 24 bytes larger and the
deepest formula’s load 192 KiB deeper).
Implementations§
Source§impl RefExpr
impl RefExpr
Sourcepub fn moved(&self, d_row: i64, d_col: i64) -> Option<(u32, u32, u32, u32)>
pub fn moved(&self, d_row: i64, d_col: i64) -> Option<(u32, u32, u32, u32)>
The rectangle this reference names in a cell d_row rows down and
d_col columns right of the cell whose formula it was read from: each
relative number moved and each $ one kept, corner by corner as
written, then sorted, which is what parsing the text that
refers::shift_a1_references moves gives (KERNEL.22, a shape
evaluated at an offset); None when a corner leaves the sheet,
where the mover writes #REF!. At no offset it is the rectangle as
read.