parseman 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/diagnose.d.ts +118 -0
- package/dist/analysis/diagnose.d.ts.map +1 -0
- package/dist/analysis/gating.d.ts +9 -9
- package/dist/analysis/gating.d.ts.map +1 -1
- package/dist/analysis/grammar.d.ts.map +1 -1
- package/dist/combinators/attempt.d.ts.map +1 -1
- package/dist/combinators/choice.d.ts.map +1 -1
- package/dist/combinators/dispatch.d.ts +19 -1
- package/dist/combinators/dispatch.d.ts.map +1 -1
- package/dist/combinators/expect.d.ts.map +1 -1
- package/dist/combinators/first-set.d.ts.map +1 -1
- package/dist/combinators/grammar.d.ts +7 -0
- package/dist/combinators/grammar.d.ts.map +1 -1
- package/dist/combinators/map.d.ts +11 -0
- package/dist/combinators/map.d.ts.map +1 -1
- package/dist/combinators/node.d.ts +19 -0
- package/dist/combinators/node.d.ts.map +1 -1
- package/dist/combinators/token.d.ts +3 -2
- package/dist/combinators/token.d.ts.map +1 -1
- package/dist/combinators/trivia-skip.d.ts +1 -0
- package/dist/combinators/trivia-skip.d.ts.map +1 -1
- package/dist/compiler/build-arity.d.ts +28 -0
- package/dist/compiler/build-arity.d.ts.map +1 -1
- package/dist/compiler/codegen.d.ts +80 -60
- package/dist/compiler/codegen.d.ts.map +1 -1
- package/dist/compiler/degradation.d.ts +123 -0
- package/dist/compiler/degradation.d.ts.map +1 -0
- package/dist/compiler/fields.d.ts.map +1 -1
- package/dist/compiler/grammar-coverage-ids.d.ts.map +1 -1
- package/dist/compiler/inline-build.d.ts.map +1 -1
- package/dist/compiler/ir-serialize.d.ts.map +1 -1
- package/dist/compiler/linker.d.ts +1 -1
- package/dist/compiler/linker.d.ts.map +1 -1
- package/dist/compiler/scannable-run.d.ts +1 -1
- package/dist/compiler/scannable-run.d.ts.map +1 -1
- package/dist/compiler/trivia-fast-path.d.ts +4 -3
- package/dist/compiler/trivia-fast-path.d.ts.map +1 -1
- package/dist/coverage.d.ts +13 -0
- package/dist/coverage.d.ts.map +1 -1
- package/dist/cst/reflection.d.ts.map +1 -1
- package/dist/cst/trivia-entries.d.ts +15 -9
- package/dist/cst/trivia-entries.d.ts.map +1 -1
- package/dist/cst/trivia-kinds.d.ts +15 -11
- package/dist/cst/trivia-kinds.d.ts.map +1 -1
- package/dist/functional/run.d.ts +22 -16
- package/dist/functional/run.d.ts.map +1 -1
- package/dist/index.cjs +2131 -1594
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2131 -1594
- package/dist/index.js.map +4 -4
- package/dist/language-service/index.cjs +201 -132
- package/dist/language-service/index.cjs.map +4 -4
- package/dist/language-service/index.js +201 -132
- package/dist/language-service/index.js.map +4 -4
- package/dist/oracle/digest.d.ts +132 -6
- package/dist/oracle/digest.d.ts.map +1 -1
- package/dist/oracle/index.cjs +136 -305
- package/dist/oracle/index.cjs.map +4 -4
- package/dist/oracle/index.d.ts +43 -31
- package/dist/oracle/index.d.ts.map +1 -1
- package/dist/oracle/index.js +136 -305
- package/dist/oracle/index.js.map +4 -4
- package/dist/plugin/evaluator.d.ts +3 -0
- package/dist/plugin/evaluator.d.ts.map +1 -1
- package/dist/plugin/index.cjs +2333 -1721
- package/dist/plugin/index.cjs.map +4 -4
- package/dist/plugin/index.d.ts +18 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +2333 -1721
- package/dist/plugin/index.js.map +4 -4
- package/dist/plugin/reducer-resolver.d.ts +41 -0
- package/dist/plugin/reducer-resolver.d.ts.map +1 -0
- package/dist/run/index.cjs +185 -132
- package/dist/run/index.cjs.map +3 -3
- package/dist/run/index.d.ts +1 -1
- package/dist/run/index.d.ts.map +1 -1
- package/dist/run/index.js +185 -132
- package/dist/run/index.js.map +3 -3
- package/dist/spec/index.cjs +1637 -1322
- package/dist/spec/index.cjs.map +4 -4
- package/dist/spec/index.js +1637 -1322
- package/dist/spec/index.js.map +4 -4
- package/dist/spec/model.d.ts.map +1 -1
- package/dist/types.d.ts +31 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +7 -3
- package/dist/combinators/guard.d.ts +0 -8
- package/dist/combinators/guard.d.ts.map +0 -1
- package/dist/cst/offset-model.d.ts +0 -119
- package/dist/cst/offset-model.d.ts.map +0 -1
- package/dist/oracle/corpus.d.ts +0 -32
- package/dist/oracle/corpus.d.ts.map +0 -1
- package/dist/oracle/identity.d.ts +0 -117
- package/dist/oracle/identity.d.ts.map +0 -1
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Combinator, FirstSet, ParseResult, ParseContext, ParseError } from '../types.ts';
|
|
10
10
|
import { type HostMode } from '../cst/host-mode.ts';
|
|
11
|
-
import { type GatingReport, type GatingWarnLevel } from '../analysis/gating.ts';
|
|
12
11
|
import { type DuplicationWarnLevel } from '../analysis/duplication.ts';
|
|
13
12
|
/**
|
|
14
13
|
* A rule's LEADING first-set as a fuse-resolvable recipe.
|
|
@@ -58,12 +57,47 @@ import { type GrammarReflection } from '../cst/reflection.ts';
|
|
|
58
57
|
* arity-gates host capture; shared, un-namespaced, mirrors `_EMPTY_TL` placement.
|
|
59
58
|
*/
|
|
60
59
|
export declare const HOST_READS_DECL = "const _hostReads = (b, n) => { if (b === undefined) return false; let s; try { s = Function.prototype.toString.call(b) } catch (e) { return true } if (/\\barguments\\b/.test(s)) return true; const m = /^[^(]*\\(([\\s\\S]*?)\\)/.exec(s); if (m && /\\.\\.\\.|=/.test(m[1])) return true; return b.length > n }";
|
|
60
|
+
/**
|
|
61
|
+
* Raw-children coercion, hoisted out of every node site.
|
|
62
|
+
*
|
|
63
|
+
* The `rawChildren` entry for a produced value is either the value itself (when it
|
|
64
|
+
* is already a tagged CST thing) or a synthesized leaf. Inlined, that test plus the
|
|
65
|
+
* leaf literal is ~300 bytes emitted PER `node()` site — measured at 2.6% of
|
|
66
|
+
* `example/css`, 7.1% of `probe/node-scale-32`, 11.2% of `probe/trivia-off`.
|
|
67
|
+
*
|
|
68
|
+
* Allocation behaviour is preserved exactly, which is why `span` is the last
|
|
69
|
+
* parameter and may be absent:
|
|
70
|
+
* - line-tracked grammars already hold their span in a local, so they pass it and
|
|
71
|
+
* nothing extra is allocated;
|
|
72
|
+
* - untracked grammars pass nothing and the `{ start, end }` literal is built
|
|
73
|
+
* INSIDE, on the fallback branch only — exactly where the inline form built it.
|
|
74
|
+
* Passing the literal as an argument instead would have allocated a span on the
|
|
75
|
+
* fast path, which is the one thing this hoist must not do.
|
|
76
|
+
*/
|
|
77
|
+
export declare const RAW_ENTRY_DECL = "const _rawEntry = (v, input, s, e, span) => (typeof v === 'object' && v !== null && (v._tag === 'node' || v._tag === 'leaf' || v._tag === 'parseError')) ? v : { _tag: 'leaf', value: typeof v === 'string' ? v : (typeof v === 'object' && v !== null ? input.slice(s, e) : ''), span: span ?? { start: s, end: e } }";
|
|
61
78
|
export declare const LINE_TRACK_DECL = "const _trackLines = (_ctx, input, start, end) => { const from = _ctx._lineScannedTo ?? 0; if (end <= from) return; for (let i = from; i < end; i++) if (input.charCodeAt(i) === 10) _ctx._lineStarts.push(i + 1); _ctx._lineScannedTo = end }";
|
|
62
79
|
export declare const LINE_SPAN_DECL: string;
|
|
63
80
|
/** Begin capturing regexes that fall back to `RegExp.exec` (didn't lower). */
|
|
64
81
|
export declare function beginLoweringCapture(): void;
|
|
65
82
|
/** Stop capturing and return the un-lowered regex sources seen since begin. */
|
|
66
83
|
export declare function endLoweringCapture(): string[];
|
|
84
|
+
/** One emitted function whose inline budget was spent, and what it cost. */
|
|
85
|
+
export type InlineCapSite = {
|
|
86
|
+
/** The emitted function that hit the budget. */
|
|
87
|
+
fn: string;
|
|
88
|
+
/** Approximate combinator nodes in the ref body that became a call instead. */
|
|
89
|
+
nodes: number;
|
|
90
|
+
};
|
|
91
|
+
/** Begin collecting inline-cap sites. */
|
|
92
|
+
export declare function beginInlineCapCapture(): void;
|
|
93
|
+
/** Stop collecting and return the sites, in emission order (deterministic). */
|
|
94
|
+
export declare function endInlineCapCapture(): InlineCapSite[];
|
|
95
|
+
/**
|
|
96
|
+
* One line per capped function, in the shape the degradation formatter uses so the two
|
|
97
|
+
* read alike. Says exactly what happened and exactly what to do about it, because a
|
|
98
|
+
* diagnostic that does neither is noise.
|
|
99
|
+
*/
|
|
100
|
+
export declare function formatInlineCapSites(sites: readonly InlineCapSite[], max: number): string[];
|
|
67
101
|
export declare function firstSetCond(codeVar: string, fs: FirstSet): string;
|
|
68
102
|
export declare function __setForceDisjointIf(on: boolean): void;
|
|
69
103
|
export declare function __setForceNoSharedPrefix(on: boolean): void;
|
|
@@ -94,15 +128,48 @@ export type CompiledParser<T> = {
|
|
|
94
128
|
inlineExpression: string | null;
|
|
95
129
|
/** Present only when compiled with `{ coverage: true }`. */
|
|
96
130
|
coverageDefinitions?: readonly import('./grammar-coverage-ids.ts').GrammarCoverageDefinition[];
|
|
97
|
-
/**
|
|
98
|
-
* Static first-char gating diagnostic for this grammar (per-choice gated/
|
|
99
|
-
* recoverable/ungated + offending arm + cause + anti-patterns). Computed unless
|
|
100
|
-
* `{ gating: 'off' }`. Warnings for genuinely-ungated hot choices are emitted at
|
|
101
|
-
* compile time by default (see the `gating` option); this is the programmatic
|
|
102
|
-
* view for CI budget snapshots. See `src/analysis/gating.ts`.
|
|
103
|
-
*/
|
|
104
|
-
gating?: GatingReport;
|
|
105
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* INLINE EXPANSION CAP — a bound on how much one emitted function may grow by pasting
|
|
134
|
+
* single-use ref bodies into it.
|
|
135
|
+
*
|
|
136
|
+
* The decision procedure, in one sentence: **each emitted function gets a budget of
|
|
137
|
+
* `INLINE_MAX_NODES` combinator nodes of inlined single-use refs; once it is spent, the
|
|
138
|
+
* remaining single-use refs in that function become named functions and are called.**
|
|
139
|
+
*
|
|
140
|
+
* What this limits, precisely. `emitLazy` inlines a ref that is used ONCE and is not
|
|
141
|
+
* recursive, because hoisting a function nobody else calls is pure overhead. That is
|
|
142
|
+
* correct per ref and unbounded in aggregate: a rule whose body is a chain of
|
|
143
|
+
* single-use helpers expands transitively, and the expansion has no ceiling that a
|
|
144
|
+
* grammar author can see or predict. This is NOT the identity-keyed hoisting of a
|
|
145
|
+
* MULTIPLY-referenced subtree (`HOIST_MIN_SUBTREE` above) — that already works, and a
|
|
146
|
+
* shared object referenced 1 or 38 times emits flat. Conflating the two is what made
|
|
147
|
+
* the size problem look like a duplication problem.
|
|
148
|
+
*
|
|
149
|
+
* Why a per-function budget rather than a per-ref size limit or a whole-artifact budget:
|
|
150
|
+
* - a per-ref limit bounds each paste but not the transitive total, which is the
|
|
151
|
+
* quantity that actually grows;
|
|
152
|
+
* - a whole-artifact budget needs an eviction order, and any order that depends on
|
|
153
|
+
* which function was compiled first is a decision the author cannot predict;
|
|
154
|
+
* - a per-function budget needs no eviction order at all. Emission order within one
|
|
155
|
+
* function is the grammar's own left-to-right order, so "the refs after the budget
|
|
156
|
+
* runs out" is stable and explainable.
|
|
157
|
+
*
|
|
158
|
+
* Charge unit is `subtreeSizes` — the same approximate node count `HOIST_MIN_SUBTREE`
|
|
159
|
+
* uses, so the two policies are denominated in one currency.
|
|
160
|
+
*
|
|
161
|
+
* The default is measured, not chosen by taste: see `bench/size/inline-cap.md` for the
|
|
162
|
+
* size/speed sweep this number came from.
|
|
163
|
+
*/
|
|
164
|
+
export declare const INLINE_MAX_NODES = 1000;
|
|
165
|
+
/**
|
|
166
|
+
* Resolve the cap: explicit option wins, then `PARSEMAN_MAX_INLINE`, then the default.
|
|
167
|
+
* The escape hatch is deliberately explicit and OFF by default — a grammar that really
|
|
168
|
+
* wants unbounded inlining sets `Infinity` and says so, rather than discovering that a
|
|
169
|
+
* silent policy took it away. Read ONCE per compile and stored on the ctx, so a single
|
|
170
|
+
* compile can never observe two different values.
|
|
171
|
+
*/
|
|
172
|
+
export declare function resolveInlineMax(explicit?: number): number;
|
|
106
173
|
/**
|
|
107
174
|
* Dependency manifest for the linkable form: for each rule in the map, the set
|
|
108
175
|
* of OTHER rule names its body references (by name). A referenced rule is a
|
|
@@ -121,54 +188,6 @@ export declare function ruleDependencies(ruleMap: ReadonlyArray<readonly [string
|
|
|
121
188
|
*
|
|
122
189
|
* @see https://www.greadme.com/blog/security/what-is-content-security-policy-complete-guide
|
|
123
190
|
*/
|
|
124
|
-
/**
|
|
125
|
-
* Resolve the gating-diagnostic level: explicit option wins, else the
|
|
126
|
-
* `PARSEMAN_GATING` env var, else default-on `'warn'`. `'off'` skips the analysis
|
|
127
|
-
* entirely; `'warn'` prints via `console.warn`; `'error'` throws when any
|
|
128
|
-
* genuinely-ungated hot choice (or anti-pattern) is found.
|
|
129
|
-
*/
|
|
130
|
-
/**
|
|
131
|
-
* The `gating` compile option. A bare level is shorthand for `{ level }`; the
|
|
132
|
-
* object form adds the accepted-snapshot `accept` allowlist (choice ids that are
|
|
133
|
-
* intentionally ungated — silent, and excluded from the `'error'` gate).
|
|
134
|
-
*/
|
|
135
|
-
export type GatingOption = GatingWarnLevel | {
|
|
136
|
-
level?: GatingWarnLevel;
|
|
137
|
-
accept?: Iterable<string>;
|
|
138
|
-
entryName?: string;
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* The FUSE-time form of the diagnostic — the only site where a shared shape's
|
|
142
|
-
* `g.Foo` hole has an answer.
|
|
143
|
-
*
|
|
144
|
-
* A shape module (`rules(g => ({ Term: choice(sequence(g.Value, …), …) }))`) cannot
|
|
145
|
-
* decide whether `Term` gates: `g.Value` is unbound there, so its first-set reads
|
|
146
|
-
* `any`. `analyzeGatingRules` marks such a choice `deferred` rather than `ungated` —
|
|
147
|
-
* warning about it would describe a configuration that never runs, and its author
|
|
148
|
-
* has nothing to fix. This runs the SAME analysis over the fused winner map, where
|
|
149
|
-
* `Value` is bound, and reports what the binding actually produced.
|
|
150
|
-
*
|
|
151
|
-
* Threading `gating` into the per-piece `compileLinkable` calls would NOT do this:
|
|
152
|
-
* each piece is lowered alone, so the hole is still unbound and the shape's own false
|
|
153
|
-
* positive is simply re-emitted. Resolution needs the MERGED map.
|
|
154
|
-
*
|
|
155
|
-
* Reports ONLY choices their authoring site deferred (the local, resolver-free pass
|
|
156
|
-
* names them). That is what keeps an ordinary hole-free grammar from being warned
|
|
157
|
-
* about twice — once by `compileRuleMap` and again by every `compose()` that fuses
|
|
158
|
-
* it. Anti-patterns are structural and already reported at the authoring site, so
|
|
159
|
-
* they are dropped here for the same reason.
|
|
160
|
-
*
|
|
161
|
-
* The rule maps arrive as a THUNK because producing them costs a re-hydration of the
|
|
162
|
-
* carried IR: `gating: 'off'` must not pay for a diagnostic it will not print.
|
|
163
|
-
*/
|
|
164
|
-
export declare function runFusedGatingDiagnostic(getRuleMaps: () => ReadonlyArray<ReadonlyArray<readonly [string, Combinator<unknown>]>>, opt?: GatingOption,
|
|
165
|
-
/** Carried pieces that could NOT be re-lowered to combinators (opaque precompiled
|
|
166
|
-
* artifacts). Threaded by BOTH engines — the runtime linker and the macro plugin —
|
|
167
|
-
* so neither can report a clean fuse over a grammar it only partly saw. */
|
|
168
|
-
getOpaque?: () => ReadonlyArray<{
|
|
169
|
-
ns: string;
|
|
170
|
-
ruleNames: string[];
|
|
171
|
-
}>): GatingReport | undefined;
|
|
172
191
|
/**
|
|
173
192
|
* The `duplication` compile option. A bare level is shorthand for `{ level }`; the
|
|
174
193
|
* object form adds the `accept` allowlist (finding ids acknowledged as intentional)
|
|
@@ -192,9 +211,9 @@ export declare function compile<T>(combinator: Combinator<T>, mapFnSources?: str
|
|
|
192
211
|
recovery?: boolean;
|
|
193
212
|
hostMode?: HostMode;
|
|
194
213
|
coverage?: boolean;
|
|
195
|
-
gating?: GatingOption;
|
|
196
214
|
duplication?: DuplicationOption;
|
|
197
215
|
trackLines?: boolean;
|
|
216
|
+
maxInline?: number;
|
|
198
217
|
}): CompiledParser<T>;
|
|
199
218
|
export declare function compileRuleMap(ruleMap: ReadonlyArray<readonly [string, Combinator<unknown>]>, opts?: {
|
|
200
219
|
trivia?: Combinator<unknown>;
|
|
@@ -203,8 +222,8 @@ export declare function compileRuleMap(ruleMap: ReadonlyArray<readonly [string,
|
|
|
203
222
|
hostMode?: HostMode;
|
|
204
223
|
trackLines?: boolean;
|
|
205
224
|
coverage?: boolean;
|
|
206
|
-
gating?: GatingOption;
|
|
207
225
|
duplication?: DuplicationOption;
|
|
226
|
+
maxInline?: number;
|
|
208
227
|
}): {
|
|
209
228
|
keys: string[];
|
|
210
229
|
replacement: string;
|
|
@@ -269,6 +288,7 @@ export type LinkablePieces = {
|
|
|
269
288
|
deps: Map<string, string[]>;
|
|
270
289
|
needsEmptyTl: boolean;
|
|
271
290
|
needsHostReads: boolean;
|
|
291
|
+
needsRawEntry: boolean;
|
|
272
292
|
/** Compile-time host mode this piece was lowered for ('ast' when absent). */
|
|
273
293
|
hostMode?: HostMode;
|
|
274
294
|
/** Set when a direct builder's positioned-CST branch was omitted. */
|
|
@@ -296,8 +316,8 @@ export declare function compileLinkable(ruleMapArg: ReadonlyArray<readonly [stri
|
|
|
296
316
|
trackLines?: boolean;
|
|
297
317
|
captureTerminals?: boolean;
|
|
298
318
|
coverage?: GrammarCoveragePlan;
|
|
299
|
-
gating?: GatingOption;
|
|
300
319
|
duplication?: DuplicationOption;
|
|
320
|
+
maxInline?: number;
|
|
301
321
|
}): LinkablePieces | null;
|
|
302
322
|
/**
|
|
303
323
|
* Does this rule map reference a rule it doesn't define — a NAMED `ref` (`g.Foo`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/compiler/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,UAAU,EAAa,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAA4B,MAAM,aAAa,CAAA;AAKnI,OAAO,EAA4B,KAAK,QAAQ,EAAE,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AmB,CAAC;IAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACxP,cAAc,GAAG,IAAI,CA4QvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAC7D,OAAO,CAeT"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Degradation diagnostics — "parseman could not do the fast/complete thing here".
|
|
3
|
+
*
|
|
4
|
+
* A fallback that is CORRECT but slower (or less complete) and announces nothing is
|
|
5
|
+
* indistinguishable from working properly. Every such path in the compiler and the
|
|
6
|
+
* analysis APIs reports through this one channel so a consumer's build gate can
|
|
7
|
+
* assert ZERO degradations, exactly the way jess's `check:macro` already asserts zero
|
|
8
|
+
* `"falling back to runtime"` lines.
|
|
9
|
+
*
|
|
10
|
+
* Machine-greppable contract (stable across minor versions):
|
|
11
|
+
*
|
|
12
|
+
* [parseman] degraded [<code>] <where>: <subject> — <fell back to>; otherwise <what>
|
|
13
|
+
*
|
|
14
|
+
* Grep token is the literal `[parseman] degraded`. The `<code>` is a stable kebab-case
|
|
15
|
+
* identifier; new codes may be added, existing ones are not renamed without a note in
|
|
16
|
+
* CHANGELOG.md.
|
|
17
|
+
*
|
|
18
|
+
* NOT for: user errors (those throw), un-taken optimizations that cost nothing, or
|
|
19
|
+
* anything a grammar author cannot act on. A diagnostic that fires on every rule gets
|
|
20
|
+
* filtered out and becomes the same silence we are trying to end — so a code that is
|
|
21
|
+
* common and unavoidable AGGREGATES (see `DETAIL_CAP`) into one summary line with a
|
|
22
|
+
* count instead of one line per rule.
|
|
23
|
+
*/
|
|
24
|
+
/** Off / print / throw. */
|
|
25
|
+
export type DegradationLevel = 'off' | 'warn' | 'error';
|
|
26
|
+
/** Stable, greppable code per degradation class. */
|
|
27
|
+
export type DegradationCode =
|
|
28
|
+
/** A node build's formal parameter list could not be read → all capture tiers kept. */
|
|
29
|
+
'build-arity-unconfirmed'
|
|
30
|
+
/** A node build looks like an `mk(...)` wrapper but did not match → no inline-mk. */
|
|
31
|
+
| 'mk-inline-missed'
|
|
32
|
+
/** A composed/carried piece is an opaque artifact → its rules were not analysed. */
|
|
33
|
+
| 'opaque-artifact'
|
|
34
|
+
/** A coverage-definition request could not read the grammar → empty is NOT a zero. */
|
|
35
|
+
| 'coverage-definitions-unavailable';
|
|
36
|
+
/**
|
|
37
|
+
* Severity. `warn` = a real, measurable cost the author can remove. `info` = the author
|
|
38
|
+
* has nothing to act on (e.g. an imported reducer in someone else's package), but the
|
|
39
|
+
* fact still has to be visible and countable.
|
|
40
|
+
*/
|
|
41
|
+
export type DegradationSeverity = 'warn' | 'info';
|
|
42
|
+
export type Degradation = {
|
|
43
|
+
code: DegradationCode;
|
|
44
|
+
severity: DegradationSeverity;
|
|
45
|
+
/** Rule / node type / artifact the cost lands on. Never a bare "<unknown>" if avoidable. */
|
|
46
|
+
where: string;
|
|
47
|
+
/** The reducer, identifier, or input that could not be analysed. */
|
|
48
|
+
subject: string;
|
|
49
|
+
/** What parseman did instead. */
|
|
50
|
+
fellBackTo: string;
|
|
51
|
+
/** What it would have done had the input been analysable. */
|
|
52
|
+
otherwise: string;
|
|
53
|
+
};
|
|
54
|
+
/** One line per finding, in the documented greppable shape. */
|
|
55
|
+
export declare function formatDegradation(d: Degradation): string;
|
|
56
|
+
/** Group by code, cap the detail lines, and append a counted summary for the rest. */
|
|
57
|
+
export declare function formatDegradations(list: readonly Degradation[]): string[];
|
|
58
|
+
/** Begin collecting degradations instead of printing them. */
|
|
59
|
+
export declare function beginDegradationCapture(): void;
|
|
60
|
+
/** Stop collecting and return the findings (deduped, insertion-ordered). */
|
|
61
|
+
export declare function endDegradationCapture(): Degradation[];
|
|
62
|
+
/** Open-sink depth, for a caller that must unwind exactly its own frames. */
|
|
63
|
+
export declare function degradationCaptureDepth(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Close every sink opened above `depth` and return their findings, outermost first.
|
|
66
|
+
*
|
|
67
|
+
* The safety net for an ABORTED capture. `beginDegradationCapture()` and its matching
|
|
68
|
+
* `end` used to sit on the straight-line path of a function that throws between them, so
|
|
69
|
+
* one failed macro transform left the sink open for the REST OF THE PROCESS: every later
|
|
70
|
+
* `recordDegradation` — including from an unrelated runtime `compile()` — went into a
|
|
71
|
+
* dead Map and printed nothing. Calling this from a `finally` bounds the damage to the
|
|
72
|
+
* frame that failed, and returns what it had collected so it can still be reported
|
|
73
|
+
* rather than silently dropped.
|
|
74
|
+
*/
|
|
75
|
+
export declare function unwindDegradationCapture(depth: number): Degradation[];
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the level: explicit argument wins, else `PARSEMAN_DEGRADATION`, else
|
|
78
|
+
* default-on `'warn'`. Default-on is the whole point — this exists because the
|
|
79
|
+
* default was silence.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveDegradationLevel(explicit?: DegradationLevel): DegradationLevel;
|
|
82
|
+
/**
|
|
83
|
+
* Record one degradation. Deduped on `code + where + subject`, so the four capture-tier
|
|
84
|
+
* probes that all consult the same unreadable parameter list produce ONE finding, not
|
|
85
|
+
* four.
|
|
86
|
+
*
|
|
87
|
+
* With a sink open (a macro transform) the finding is collected and the drain site
|
|
88
|
+
* decides what to do with it. With NO sink open — a runtime `compile()` — this is the
|
|
89
|
+
* only place that ever sees the finding, so it is also the only place that can honour
|
|
90
|
+
* `'error'`. It therefore throws here. `docs/guide/degradation-diagnostics.md` documents
|
|
91
|
+
* `PARSEMAN_DEGRADATION=error` as "fail the build" without qualification, and until this
|
|
92
|
+
* throw existed that was false in library mode: `error` silently behaved as `warn`,
|
|
93
|
+
* because `endDegradationCapture()` had exactly one call site, in the macro plugin.
|
|
94
|
+
*/
|
|
95
|
+
export declare function recordDegradation(d: Degradation): void;
|
|
96
|
+
/**
|
|
97
|
+
* Open a per-`compile()` drain and return the function that closes it.
|
|
98
|
+
*
|
|
99
|
+
* This channel stays LOUD. `compile()` no longer prints gating advice — that is a
|
|
100
|
+
* deliberate diagnostic now (`diagnoseGrammar`) — but a degradation is not advice: it
|
|
101
|
+
* is parseman reporting that it could not do the thing the caller asked for, and this
|
|
102
|
+
* release exists to stop that happening silently. What changes here is only the SHAPE.
|
|
103
|
+
*
|
|
104
|
+
* Before, the sink-less path printed one ~500-character line per site as it went, with
|
|
105
|
+
* no aggregation — 31 of them for a single code in one `pnpm perf:workloads` run, each
|
|
106
|
+
* repeating the same advice. The macro drain has always aggregated (`formatDegradations`,
|
|
107
|
+
* `DETAIL_CAP`); the runtime path simply had no drain to aggregate at. It has one now,
|
|
108
|
+
* so both paths report the same way and a real count survives instead of a wall.
|
|
109
|
+
*
|
|
110
|
+
* Nested inside a macro transform this is a NO-OP: that transform's sink owns the whole
|
|
111
|
+
* module's findings and returns them on the bundler's warning channel. A per-compile
|
|
112
|
+
* drain underneath it would steal them and print them instead.
|
|
113
|
+
*
|
|
114
|
+
* @returns `drain(report)` — always unwinds the sink (so a `compile()` that throws
|
|
115
|
+
* cannot leave it open for the rest of the process), and reports only when
|
|
116
|
+
* `report` is true, so a failed compile does not mask its own error with a second one.
|
|
117
|
+
*/
|
|
118
|
+
export declare function beginCompileDegradationDrain(): (report: boolean) => void;
|
|
119
|
+
/** Test-only: forget the sink-less dedup memo. */
|
|
120
|
+
export declare function resetDegradationMemo(): void;
|
|
121
|
+
/** Test-only: is a sink open? Guards against a leaked capture between test files. */
|
|
122
|
+
export declare function hasOpenDegradationSink(): boolean;
|
|
123
|
+
//# sourceMappingURL=degradation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"degradation.d.ts","sourceRoot":"","sources":["../../src/compiler/degradation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,2BAA2B;AAC3B,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,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AI,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAsBxE;AAED,kDAAkD;AAClD,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/compiler/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlE,KAAK,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/compiler/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlE,KAAK,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKtD;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,GAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAa,GAAG,OAAO,CAmC9G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,GAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAa,GAAG,OAAO,CA4C/G;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,GAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAa,GAAG,OAAO,CAmCtH;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAW/J"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar-coverage-ids.d.ts","sourceRoot":"","sources":["../../src/compiler/grammar-coverage-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"grammar-coverage-ids.d.ts","sourceRoot":"","sources":["../../src/compiler/grammar-coverage-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAGxD,MAAM,MAAM,yBAAyB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc,GAAG,OAAO,CAAA;CAAE,CAAA;AAC9G,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,SAAS,yBAAyB,EAAE,CAAA;IACjD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC,CAAA;IACxD,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC,CAAA;IAC3D;gFAC4E;IAC5E,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAA;IAC9C,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC,CAAA;IACvD,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAA;CAC5C,CAAA;AAmDD;;yCAEyC;AACzC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,mBAAmB,CA2DhK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-build.d.ts","sourceRoot":"","sources":["../../src/compiler/inline-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"inline-build.d.ts","sourceRoot":"","sources":["../../src/compiler/inline-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AA+D5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,GAAG,IAAI,CAmB5F;AAeD,gFAAgF;AAChF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAER"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-serialize.d.ts","sourceRoot":"","sources":["../../src/compiler/ir-serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAkC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ir-serialize.d.ts","sourceRoot":"","sources":["../../src/compiler/ir-serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAkC,MAAM,aAAa,CAAA;AAsB7E,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AA+E/B,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAC/C,QAAQ,CAAC,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,GAChC,MAAM,GAAG,IAAI,CAUf;AAED;;oFAEoF;AACpF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAyG/D"}
|
|
@@ -98,7 +98,7 @@ export type IRPiece = {
|
|
|
98
98
|
* and must not happen twice when it is on. */
|
|
99
99
|
export declare function once<T>(fn: () => T): () => T;
|
|
100
100
|
/** The re-lowerable carried pieces' rule maps, in compose order — the input to the
|
|
101
|
-
*
|
|
101
|
+
* gating analysis (`diagnoseGrammar`). An opaque precompiled artifact contributes no
|
|
102
102
|
* combinator graph, so it is skipped: a hole it would have bound stays unresolved
|
|
103
103
|
* and its choice stays deferred, never falsely warned.
|
|
104
104
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../src/compiler/linker.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,cAAc,EAAkB,QAAQ,EAAE,MAAM,cAAc,CAAA;AAG5E,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAY,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAcnH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAC7C,EAAE,CAAC,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,UAAU,CAA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E,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,SAAS,CAa7G;AAmBD;;gFAEgF;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAEvH;AAED;qEACqE;AACrE,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,cAAc,GAAG,OAAO,EAC3B,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAC5B,gBAAgB,UAAQ,EACxB,QAAQ,CAAC,EAAE,QAAQ,GAClB,cAAc,CAchB;AAoFD,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACtD;;;;;;;GAOG;AACH,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,GAC7B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAoB3B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAE3B"}
|
|
@@ -166,5 +166,5 @@ export declare function scanBranch(shape: ScanShape, mint: Mint): string;
|
|
|
166
166
|
* A labeled branch: match one token and, on progress, log its [start, end,
|
|
167
167
|
* kindIndex] trivia chunk. Same completion semantics as scanBranch.
|
|
168
168
|
*/
|
|
169
|
-
export declare function scanBranchLabeled(shape: ScanShape, kindIndex: number, mint: Mint): string;
|
|
169
|
+
export declare function scanBranchLabeled(shape: ScanShape, kindIndex: number, label: string, mint: Mint): string;
|
|
170
170
|
//# sourceMappingURL=scannable-run.d.ts.map
|
|
@@ -1 +1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D,CAAA;AAEjB,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,YAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAE7D,0FAA0F;AAC1F,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC5C,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAIzB;AAED,sEAAsE;AACtE,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;AAE9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAoCrE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,SAAS,CAAC,EAAE,MAAM,GACjB,UAAU,CAuTZ;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAG/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAexG"}
|
|
@@ -16,18 +16,19 @@ export declare function buildFastTriviaFnDecl(fnName: string, shapes: ScanShape[
|
|
|
16
16
|
/**
|
|
17
17
|
* A LABELED trivia parser whose every arm is scannable → per-arm shape + kind
|
|
18
18
|
* index, or null. Same recognition as analyzeTriviaFastPath, but keyed by the
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* shape set / arm count.
|
|
19
|
+
* label table so the fast loop can log each chunk's category. It accepts any
|
|
20
|
+
* structurally scannable arm set / arm count; labels do not affect recognition.
|
|
22
21
|
*/
|
|
23
22
|
export declare function analyzeLabeledScannableRun(trivia: Combinator<unknown>): Array<{
|
|
24
23
|
shape: ScanShape;
|
|
25
24
|
kindIndex: number;
|
|
25
|
+
label: string;
|
|
26
26
|
}> | null;
|
|
27
27
|
/** Emit a labeled scannable trivia `_tfN`: char-scan loop with per-chunk kind capture. */
|
|
28
28
|
export declare function buildLabeledScannableTriviaFnDecl(fnName: string, arms: ReadonlyArray<{
|
|
29
29
|
shape: ScanShape;
|
|
30
30
|
kindIndex: number;
|
|
31
|
+
label: string;
|
|
31
32
|
}>): string;
|
|
32
33
|
/** Labeled trivia with regex arms — per-chunk kind capture in compiled output. */
|
|
33
34
|
export declare function buildLabeledRegexTriviaFnDecl(fnName: string, spec: LabeledTriviaSpec, reNames: string[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trivia-fast-path.d.ts","sourceRoot":"","sources":["../../src/compiler/trivia-fast-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"trivia-fast-path.d.ts","sourceRoot":"","sources":["../../src/compiler/trivia-fast-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,EAAE,KAAK,SAAS,EAAgE,MAAM,oBAAoB,CAAA;AAgCjH;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,IAAI,CAyBrF;AA2BD,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CASjF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAC1B,KAAK,CAAC;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,IAAI,CAWtE;AAED,0FAA0F;AAC1F,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC1E,MAAM,CAeR;AAED,kFAAkF;AAClF,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,MAAM,EAAE,GAChB,MAAM,CAmCR;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,iBAAiB,GAAG,IAAI,CAO5F;AAED,4EAA4E;AAC5E,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,YAAY,EAAE,MAAM,GACnB,MAAM,CAkCR"}
|
package/dist/coverage.d.ts
CHANGED
|
@@ -6,7 +6,20 @@ export type GrammarCoverageSnapshot = {
|
|
|
6
6
|
definitions: readonly GrammarCoverageDefinition[];
|
|
7
7
|
hits: readonly string[];
|
|
8
8
|
unhit: readonly string[];
|
|
9
|
+
/**
|
|
10
|
+
* Hit fraction, or `NaN` when there was NOTHING TO MEASURE.
|
|
11
|
+
*
|
|
12
|
+
* An empty definition set is not full coverage. This used to report `1` for it, so a
|
|
13
|
+
* grammar whose definitions failed to load — the exact case
|
|
14
|
+
* `'coverage-definitions-unavailable'` exists for — presented as 100% covered, and any
|
|
15
|
+
* consumer gate of the shape `ratio >= threshold` passed on zero evidence. `NaN`
|
|
16
|
+
* compares false against every threshold, so the gate now FAILS CLOSED by default
|
|
17
|
+
* instead of passing by default. Read `measurable` to tell "nothing to measure" from a
|
|
18
|
+
* genuine 0%.
|
|
19
|
+
*/
|
|
9
20
|
ratio: number;
|
|
21
|
+
/** False when the definition set was empty, i.e. `ratio` is not a measurement. */
|
|
22
|
+
measurable: boolean;
|
|
10
23
|
};
|
|
11
24
|
export type GrammarCoverageCollector = {
|
|
12
25
|
hit(id: string): void;
|
package/dist/coverage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../src/coverage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,KAAK,EAAE,UAAU,EAAqC,YAAY,EAAe,MAAM,YAAY,CAAA;AAmB1G,OAAO,EAAoB,KAAK,yBAAyB,EAA4B,MAAM,oCAAoC,CAAA;AAE/H,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAA;AAcnF,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,SAAS,yBAAyB,EAAE,CAAA;IACjD,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IACvB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../src/coverage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACzF,OAAO,KAAK,EAAE,UAAU,EAAqC,YAAY,EAAe,MAAM,YAAY,CAAA;AAmB1G,OAAO,EAAoB,KAAK,yBAAyB,EAA4B,MA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,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,uBAAuB,CAAA;CAAE,CAO9N"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../../src/cst/reflection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAExD,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAA0D,CAAA;AAClG,eAAO,MAAM,SAAS,EAAE,OAAO,MAAsD,CAAA;AACrF,eAAO,MAAM,QAAQ,EAAE,OAAO,MAAqD,CAAA;AAEnF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,qBAAqB,CAC/B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,OAAO,SAAS,MAAM,GAAG,MAAM,IAC7B;IACF,QAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE,iBAAiB,CAAA;IACjD,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAA;IAC/B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;
|
|
1
|
+
{"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../../src/cst/reflection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAExD,eAAO,MAAM,kBAAkB,EAAE,OAAO,MAA0D,CAAA;AAClG,eAAO,MAAM,SAAS,EAAE,OAAO,MAAsD,CAAA;AACrF,eAAO,MAAM,QAAQ,EAAE,OAAO,MAAqD,CAAA;AAEnF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,qBAAqB,CAC/B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,OAAO,SAAS,MAAM,GAAG,MAAM,IAC7B;IACF,QAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE,iBAAiB,CAAA;IACjD,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAA;IAC/B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;AAqFD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAC9D,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9B,iBAAiB,CAcnB;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,SAAS,iBAAiB,EAAE,GAAG,iBAAiB,CAepG;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,iBAAiB,GAAG,CAAC,CAGtG;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAElF;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAE7E"}
|
|
@@ -24,10 +24,10 @@ export type RootTriviaGap = {
|
|
|
24
24
|
text(input: string): string;
|
|
25
25
|
};
|
|
26
26
|
export type RootTriviaIndex = {
|
|
27
|
-
/** Lazy entry-level view over
|
|
27
|
+
/** Lazy entry-level view over sparse selected-root rows. */
|
|
28
28
|
readonly entries: TriviaEntriesView;
|
|
29
|
-
/**
|
|
30
|
-
readonly labels: readonly string[]
|
|
29
|
+
/** Selected-root label table; entry kind indices refer to this array. */
|
|
30
|
+
readonly labels: readonly string[];
|
|
31
31
|
/**
|
|
32
32
|
* Contiguous trivia gaps keyed by the following content offset. Values are
|
|
33
33
|
* entry indices into `entries`, not materialized `{ value, span }` objects.
|
|
@@ -55,6 +55,8 @@ export type RootTriviaIndex = {
|
|
|
55
55
|
/** Source-ordered gaps containing at least one entry with the given label. */
|
|
56
56
|
gapsWithKind(kind: string | readonly string[]): readonly RootTriviaGap[];
|
|
57
57
|
};
|
|
58
|
+
/** Number of packed fields in one selected-root trivia row. */
|
|
59
|
+
export declare const SELECTED_ROOT_STRIDE = 5;
|
|
58
60
|
/**
|
|
59
61
|
* Wrap a flat trivia log. Stride is inferred from `labels`:
|
|
60
62
|
* - root `_triviaLog`: 2 (start, end) or 3 (+ kindIndex)
|
|
@@ -64,11 +66,15 @@ export declare function triviaEntries(log: readonly number[], labels?: readonly
|
|
|
64
66
|
nodeLog?: boolean;
|
|
65
67
|
}): TriviaEntriesView;
|
|
66
68
|
/**
|
|
67
|
-
* Build a
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
69
|
+
* Build a root view over the sparse selected-label rows captured as
|
|
70
|
+
* `[ownedRangeStart, ownedRangeEnd, markerStart, markerEnd, kindIndex]`.
|
|
71
|
+
*
|
|
72
|
+
* This is intentionally a different input shape from `triviaLog`: each row is
|
|
73
|
+
* one selected marker, while the first pair names the complete committed trivia
|
|
74
|
+
* range around it. Thus a mixed trivia run costs one five-number row, not three
|
|
75
|
+
* legacy trivia entries. Rows are source ordered and equal gap pairs are
|
|
76
|
+
* contiguous, which lets singleton boundary lookups binary-search the sparse
|
|
77
|
+
* rows without constructing document-wide maps.
|
|
72
78
|
*/
|
|
73
|
-
export declare function buildRootTriviaIndex(log: readonly number[], labels
|
|
79
|
+
export declare function buildRootTriviaIndex(log: readonly number[], labels: readonly string[]): RootTriviaIndex;
|
|
74
80
|
//# sourceMappingURL=trivia-entries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trivia-entries.d.ts","sourceRoot":"","sources":["../../src/cst/trivia-entries.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,4EAA4E;IAC5E,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC1C,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACnC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,4EAA4E;IAC5E,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,kEAAkE;IAClE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,
|
|
1
|
+
{"version":3,"file":"trivia-entries.d.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