/** * Assembly helpers that touch NO assembly state. * * They lived inside `assemble()`'s closure, where they captured nothing but were * re-created per assembly. The emitted engine (`emit-assembly.ts`) needs the * same three answers and must not carry a second copy of them — a second copy of * `rawEntry` is how a CST leaf's span drifts between two engines that are gated * against each other precisely so it cannot. Hoisted here so both engines call * ONE definition. * * Nothing here reads configuration: `spanLines` reads `ctx._lineStarts`, which * is per-parse STATE that the line-tracking assembly populates, and `rawEntry` * reads only its arguments. */ import type { ParseContext } from '../types.ts'; export type Span = { start: number; end: number; }; export type LineSpan = Span & { startLine: number; startColumn: number; endLine: number; endColumn: number; }; /** Binary search of `ctx._lineStarts` — `[line, column]`, both 1-based. */ export declare function lineCol(ctx: ParseContext, offset: number): [number, number]; export declare function spanLines(ctx: ParseContext, start: number, end: number): LineSpan; /** * The RAW child entry a node publishes beside its projected value. * * An already-shaped node/leaf/parseError passes through; anything else is * wrapped as a leaf over the source text it spanned. */ export declare function rawEntry(v: unknown, input: string, s: number, e: number): unknown; /** `input`'s code point at `pos`, or −1 at EOF. Surrogate-pair aware. */ export declare function lead(input: string, pos: number): number; //# sourceMappingURL=run-support.d.ts.map