/** * The textual scanning primitives of the A1 editor dialect, in a leaf module of * their own so that every scanner agrees on what a reference is. * * Three scanners share them today — the commit transform (`toCanonicalFormula`), * the reference highlighter (`scanA1References`) and the completion tokenizer * (`tokenizeFormula` in A1 mode). A reference the highlighter colors is exactly a * reference the commit rewrites is exactly a reference completion treats as one * operand; they cannot drift apart. * * They live here rather than in `formulaA1.ts` because that module pulls in the * parser and the serializer, and `formulaTokenizer.ts` — which the parser itself * imports — needs them: a leaf module is what breaks the cycle. */ export declare const CELL_REF_REGEX: RegExp; export declare const IDENTIFIER_REGEX: RegExp; export declare const WHITESPACE_REGEX: RegExp; export interface ParsedRef { columnAbsolute: boolean; letters: string; rowAbsolute: boolean; rowNumber: number; } export declare function readParsedRef(match: RegExpExecArray): ParsedRef; /** * Advances past a `"`-delimited string literal (with `""` escapes), returning the * index just after the closing quote (or the end of the input when unterminated). */ export declare function scanStringLiteral(expression: string, start: number): number; /** * After a cell reference at `afterFirst`, matches an optional `: ` tail * that turns it into a `RANGE_REF`. */ export declare function matchRangeTail(expression: string, afterFirst: number): { endRef: ParsedRef; end: number; } | null; /** * Matches a `FIELD("name")` escape at `start` (function name case-insensitive, * `""` escapes in the literal, inline whitespace allowed) and returns the * unescaped field name. The A1 display dialect writes ambiguous field names — * ones that would read as cell addresses, like a field named `q1` — through * this escape, and the reference highlighter must color the whole call as one * field reference: exactly what the canonical parser turns it into at commit. * Returns `null` on anything else (`FIELD(price)`, an unterminated literal, a * different function) — those fall back to the generic scanning branches. */ export declare function matchFieldEscape(expression: string, start: number): { field: string; end: number; } | null; /** * Matches a whole-column range `A:A`. Only same-column ranges map to a single * `COLUMN_VALUES`; mixed columns return `null` and are copied verbatim. */ export declare function matchColumnRange(expression: string, start: number): { letters: string; absolute: boolean; end: number; } | null;