Whole-column and whole-row references (B:B, A:C, 1:1, 2:5)

Formulas accept B:B / A:C / $B:$B and 1:1 / 2:5 / $3:$3, also qualified
(Umsatz!B:B, Umsatz::1:1, 'Blatt 2'!Kosten::A:C). The open end is clamped
to the table's current size wherever cells are read (evaluation, the
dependency graph, SETVALUE targets, FOR sources), and typing past the
table's end now rebuilds the workbook so such a reference covers the new
cells. The Name Box selects the whole column/row.

The token-level rewriters handle the new shape: copy/fill shifts B:B only
sideways and 1:1 only up/down ($ stays), column insert/delete moves or
#REFs B:B like a range (rows leave it alone, and vice versa), and a table
rename rewrites its qualifier.

Also fixes renaming a table referenced with a quoted name ('Tabelle 1'!B2):
the rewriter replaced only as many characters as the unquoted name has,
leaving a stray quote (=Daten1'!B2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
wkh
2026-09-28 02:30:08 +02:00
co-authored by Claude Opus 5.5
parent c4d2712903
commit 452f13e774
9 changed files with 343 additions and 12 deletions
+2 -2
View File
@@ -21,7 +21,7 @@
import { DependencyGraph } from './graph';
import { collectRefs, parseFormula, type Node } from './parser';
import { expandRange } from './refs';
import { rangeCells } from './refs';
import { parseDateTimeLiteral } from './dates';
import { buildFunctionIndex, expandUserFunctions, type FunctionDef } from './userFunctions';
import {
@@ -249,7 +249,7 @@ export class Workbook implements EngineHost {
if ('col' in resolved) {
out.push(keyOf(target, resolved.col, resolved.row));
} else {
for (const c of expandRange(resolved.start, resolved.end)) {
for (const c of rangeCells(resolved, this.tableSize(target))) {
out.push(keyOf(target, c.col, c.row));
}
}