parseman 0.35.0 → 0.36.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/combinators/expect.d.ts +12 -0
- package/dist/combinators/expect.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/plugin/index.cjs +2 -2
- package/dist/plugin/index.cjs.map +2 -2
- package/dist/plugin/index.js +2 -2
- package/dist/plugin/index.js.map +2 -2
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,18 @@ export type { ParseError };
|
|
|
13
13
|
* This is what lets expect() report a meaningful, IDENTICAL expectation in both
|
|
14
14
|
* the interpreter and the compiled output (the compiled path does not rebuild the
|
|
15
15
|
* runtime `expected` array, so it reads this precomputed set instead).
|
|
16
|
+
*
|
|
17
|
+
* The result is DEDUPLICATED. Deriving through a nullable prefix re-reaches the
|
|
18
|
+
* same token from several terms — a value grammar whose leading terms are all
|
|
19
|
+
* optional names its value-start set once per term — and an expectation list that
|
|
20
|
+
* offers `"@{"` five times is wrong for a reader and expensive for a parser: a
|
|
21
|
+
* choice that loses every arm materializes `[...arm0, ...arm1, …]` at runtime, and
|
|
22
|
+
* those arrays feed the enclosing choice's concat in turn, so duplicates compound
|
|
23
|
+
* multiplicatively up the nesting. On jess's Less grammar the un-deduped sets cost
|
|
24
|
+
* 32% of parse time on `benchmark.less` (medians 20.7 → 14.2 ms over 100
|
|
25
|
+
* interleaved pairs, 99/100 wins, min 19.1 → 13.0), which is the whole of the Less
|
|
26
|
+
* regression 0.35.0 shipped. Dedup is not an optimisation bolted onto the
|
|
27
|
+
* derivation — a SET is what the derivation always meant.
|
|
16
28
|
*/
|
|
17
29
|
export declare function deriveExpected(c: Combinator<unknown>): string[];
|
|
18
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/combinators/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,UAAU,EAAE,MAAM,aAAa,CAAA;AAIhG,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/combinators/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,UAAU,EAAE,MAAM,aAAa,CAAA;AAIhG,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAE/D;AAkED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CA2B/F;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
|
package/dist/index.cjs
CHANGED
|
@@ -1155,7 +1155,7 @@ var REC = { scan: recoverScan, at: matchesAt, or: orSentinel, sentinel: firstSet
|
|
|
1155
1155
|
|
|
1156
1156
|
// src/combinators/expect.ts
|
|
1157
1157
|
function deriveExpected(c) {
|
|
1158
|
-
return derive(c, /* @__PURE__ */ new Set());
|
|
1158
|
+
return [...new Set(derive(c, /* @__PURE__ */ new Set()))];
|
|
1159
1159
|
}
|
|
1160
1160
|
function derive(c, seen) {
|
|
1161
1161
|
const deriveExpected2 = (p) => derive(p, seen);
|
|
@@ -3126,7 +3126,7 @@ function leaf(root, fn) {
|
|
|
3126
3126
|
}
|
|
3127
3127
|
|
|
3128
3128
|
// src/version.ts
|
|
3129
|
-
var PARSEMAN_VERSION = "0.
|
|
3129
|
+
var PARSEMAN_VERSION = "0.36.0";
|
|
3130
3130
|
|
|
3131
3131
|
// src/analysis/gating.ts
|
|
3132
3132
|
var isAny = (fs) => fs.kind === "any";
|