import type { Combinator } from '../types.ts'; import { type DuplicationReport, type DuplicationWarnLevel } from '../analysis/duplication.ts'; /** * THE DUPLICATION DIAGNOSTIC'S LOWERING HOOK. * * This ran inside the source lowering, so deleting that lowering would have silently * taken it with it — the analysis in `analysis/duplication.ts` would survive and * nothing would call it, which reads exactly like a clean grammar. It is not a * property of how a grammar is lowered, so it lives with the lowering that remains. */ /** * The `duplication` compile option. A bare level is shorthand for `{ level }`; the * object form adds the `accept` allowlist (finding ids acknowledged as intentional) * and the ranking knobs. * * DEFAULT IS `'off'`, unlike gating. An ungated hot choice is a cliff with no other * symptom; a duplicated subtree is a maintenance cost the author may have chosen. * More to the point, most findings here are CANDIDATES that need an AST check * before they are applied — a diagnostic that prints "candidate, verify" on every * build teaches people to stop reading it. Run it deliberately (a lint script, a * review pass, `PARSEMAN_DUPLICATION=warn`), not on every compile. */ export type DuplicationOption = DuplicationWarnLevel | { level?: DuplicationWarnLevel; accept?: Iterable; minSize?: number; maxFindings?: number; entryName?: string; }; export declare function runDuplicationDiagnostic(combinator: Combinator, opt: DuplicationOption | undefined): DuplicationReport | undefined; export declare function runDuplicationDiagnosticRules(ruleMap: ReadonlyArray]>, opt: DuplicationOption | undefined): DuplicationReport | undefined; //# sourceMappingURL=duplication-hook.d.ts.map