/** * Walking a container of MEMBERS — a ``/`` group, or a ``. * * Both of them hold the same things `` holds and want them checked the * same way, so neither can own the checks; but neither can import them either, * because `validate.ts` is where `checkSequence` and friends live and importing * back would be a cycle. The walk therefore lives here and the checks are * handed in. That keeps `validate.ts` under its line ceiling and, more usefully, * makes it impossible for a member inside a container to drift away from the * same member at the top level: there is one walk and it calls one set of * checks. */ import type { Diagnostic } from '../errors/index.js'; import type { OpenCloseElementContext, SelfClosingElementContext } from '../generated/TDCParser.js'; import { type PendingExpression } from './expr-check.js'; /** * The top-level checks, passed in by the caller so this module never imports * them. Each one takes the node and reports into the caller's own context. */ export interface MemberCheckers { readonly sequence: (node: OpenCloseElementContext) => void; readonly mix: (node: OpenCloseElementContext) => void; readonly switchTag: (node: OpenCloseElementContext) => void; } /** * The body of a ``, checked exactly as the body of an `` is. * * This function is short on purpose, and the shortness is the argument for the * whole construct: a pool holds the same members, means the same thing by them, * and therefore needs no checks of its own. Anything that would be an error one * level up is an error here, with the same code and the same wording — so an * author who has met the message before recognises it, and a port has nothing * extra to reimplement. */ /** * Everything a `` declaration is checked for, in one call. * * The env walk asks three separate questions of a pool — is its own shape sound, * may its members reach the pools they name, and does its body survive the * ordinary member checks — and they belong together: all three are "validate * this pool", and none of them means anything on its own. `above` grows as the * walk goes, which is what limits a member to the pools declared before it. */ export declare function checkPoolDeclaration(pool: OpenCloseElementContext, above: string[], diagnostics: Diagnostic[], checkers: MemberCheckers, declaredSequences: string[], /** * The expressions put aside so far. A pool's members read each other and * nothing from the run, so every `if=` written inside is narrowed to the * pool's own field names before they leave scope. */ pending?: PendingExpression[]): void; export declare function checkPoolMembers(pool: OpenCloseElementContext, diagnostics: Diagnostic[], checkers: MemberCheckers, declaredSequences: string[], onFields?: (names: readonly string[]) => void): void; /** * Config-level `` / `` (wrapping whole ``s). * Validate each wrapped sequence in declaration order — and reject a compound * sequence, which has no single value to participate in the per-row (distinct) * or cross-row (uniq) comparison. */ export declare function checkEnvSequenceGroup(wrapperEl: OpenCloseElementContext, diagnostics: Diagnostic[], tag: string, checkers: MemberCheckers): void; /** * A `` written with no body at all. * * It looks like it declares a column and it declares nothing: a self-closing * tag cannot hold the `` that says how values are produced. Until this * check existed the tag was skipped by every walker, so the config ran with the * column simply missing — and inside a `` that meant the group silently * constrained nothing while the warning above it said the group "wraps no * sequences", which is true and reads as a lie. * * It is not made to mean "the sequence X declared elsewhere joins this group". * That would give one tag two jobs — declare here, refer there — which is the * defect this codebase keeps paying to remove. A group holds its members. */ export declare function checkSelfClosingSequence(node: SelfClosingElementContext, diagnostics: Diagnostic[]): void; //# sourceMappingURL=members.d.ts.map