import type { Combinator, FieldMap, ParserDef } from '../types.ts'; type NodeDef = Extract; export declare function buildReadsFields(def: NodeDef): boolean; export declare function parserHasOwnFields(p: Combinator, seen?: Set>): boolean; /** * Does the node's OWN parse frame ever have a trivia run logged into it? * Trivia is logged only by the trivia-skip fn, which runs at `sequence`/`many`/ * repeat boundaries. A bare terminal (regex/literal/keywords/…) has NO trivia * site, so its `_cstTriviaLog` stays empty and its `captureTrivia`/`_cstTriviaLog`/ * `_triviaCaptureMask` save+install+restore is dead work — the per-node scope * trivia frame can be elided for it (see emitNode `needsTriviaFrame`). * * Stops at a nested `node()` (it manages its OWN trivia frame; trivia inside it * never logs to THIS node's frame). CONSERVATIVE: any unknown / trivia-bearing * shape returns `true` (keep the frame) — we only elide when provably safe. */ export declare function parserHasTriviaSite(p: Combinator, seen?: Set>): boolean; /** * The same question asked of the ROOT trivia log (`_ctx._rootTriviaLog`) instead * of the current node's frame. * * The two differ in exactly one case, and it is the case that matters: a nested * `node()` manages its own FRAME, so nothing inside it reaches the enclosing * frame's log — but the root log is not a frame, and every trivia run inside that * node still lands in it. Reusing `parserHasTriviaSite` for the root sink * therefore under-reports: it dropped the mark on `node()` arms whose trivia does * accumulate, and a parse-tree diff caught it as trivia entries that were no * longer rewound on a failed choice arm (`length: 3` becoming `length: 6`). */ export declare function parserHasRootTriviaSite(p: Combinator, seen?: Set>): boolean; /** * Can this node's inner grammar explicitly enable trivia capture? A surrounding * node owns the collector, so a nested `parser({ captureTrivia: true })` must * allocate that collector before it enters the grammar scope. Nested node() * rules own their separate collector and therefore do not contribute here. */ export declare function parserEnablesTriviaCapture(p: Combinator, seen?: Set>): boolean; export declare function buildFieldMap(captures: ReadonlyArray<{ name: string; value: unknown; span: { start: number; end: number; }; }> | undefined): FieldMap | undefined; export {}; //# sourceMappingURL=fields.d.ts.map