parseman 0.50.0 → 0.50.1
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/diagnostics.js +24 -7
- package/dist/analysis/diagnostics.js.map +1 -1
- package/dist/cli/index.js +24 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.js +25 -8
- package/dist/plugin/index.js.map +1 -1
- package/dist/table/encode.d.ts.map +1 -1
- package/dist/table/index.js +24 -7
- package/dist/table/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/table/encode.ts +30 -10
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/table/encode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,UAAU,EAAuB,MAAM,aAAa,CAAA;AAwBhF,OAAO,KAAK,EAAmE,YAAY,EAAc,MAAM,cAAc,CAAA;AAS7H,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AA0B9E,8EAA8E;AAC9E,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,YAAY,GAAG,EAAE,MAAM,EAAqE;CAC7F;AAED,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CACxC,CAAA;
|
|
1
|
+
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/table/encode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,UAAU,EAAuB,MAAM,aAAa,CAAA;AAwBhF,OAAO,KAAK,EAAmE,YAAY,EAAc,MAAM,cAAc,CAAA;AAS7H,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AA0B9E,8EAA8E;AAC9E,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,YAAY,GAAG,EAAE,MAAM,EAAqE;CAC7F;AAED,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CACxC,CAAA;AA2sDD,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAC5C,QAAQ,GAAE,aAAkB,GAC3B,YAAY,CAEd;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAC5C,QAAQ,GAAE,aAAkB,GAC3B;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;CAAE,CA+BnD"}
|
package/dist/table/index.js
CHANGED
|
@@ -11991,6 +11991,22 @@ var Encoder = class {
|
|
|
11991
11991
|
choiceRollbackMasks = /* @__PURE__ */ new Map();
|
|
11992
11992
|
nonCommittingChoiceSites = /* @__PURE__ */ new Set();
|
|
11993
11993
|
failureRollbackCleanSites = /* @__PURE__ */ new Set();
|
|
11994
|
+
/**
|
|
11995
|
+
* `hasSideWriter` memo for `failureNeedsRollback`, shared across every call
|
|
11996
|
+
* for the lifetime of this `Encoder`. A cached entry is written only when
|
|
11997
|
+
* `complete` is true, which means the answer is a path-independent fact
|
|
11998
|
+
* about that combinator node — it does not depend on which root's traversal
|
|
11999
|
+
* asked, only on the node's own reachable subgraph. Scoping the memo per call
|
|
12000
|
+
* (as a local inside `failureNeedsRollback`) was correct but discarded that
|
|
12001
|
+
* fact after every arm, so a grammar with many ordered-choice arms / optional
|
|
12002
|
+
* / attempt sites re-walked the SAME shared rule graph from scratch for each
|
|
12003
|
+
* site — O(sites × graph size) instead of O(graph size). Measured on the
|
|
12004
|
+
* scss-parser grammar (composed CSS-base superset, the deepest/largest of the
|
|
12005
|
+
* four grammars): 47-50s for one `compileRuleMap` with the per-call memo,
|
|
12006
|
+
* versus the whole macro transform completing in under a second once this
|
|
12007
|
+
* memo is hoisted here.
|
|
12008
|
+
*/
|
|
12009
|
+
sideWriterMemo = /* @__PURE__ */ new Map();
|
|
11994
12010
|
labels = void 0;
|
|
11995
12011
|
/** Trivia table in scope at the row being encoded — codegen's `ctx.activeTrivia`. */
|
|
11996
12012
|
activeTrivia = void 0;
|
|
@@ -12416,13 +12432,13 @@ var Encoder = class {
|
|
|
12416
12432
|
const refName = p._ruleName;
|
|
12417
12433
|
const winner = refName === void 0 ? void 0 : this.winners?.[refName];
|
|
12418
12434
|
const root = winner !== void 0 && !winnerWrapsReference2(winner, p) ? winner : p;
|
|
12419
|
-
const sideWriterMemo =
|
|
12420
|
-
const
|
|
12435
|
+
const sideWriterMemo = this.sideWriterMemo;
|
|
12436
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12437
|
+
const hasSideWriter = (current) => {
|
|
12421
12438
|
const cached = sideWriterMemo.get(current);
|
|
12422
12439
|
if (cached !== void 0) return { found: cached, complete: true };
|
|
12423
12440
|
if (seen.has(current)) return { found: false, complete: false };
|
|
12424
|
-
|
|
12425
|
-
next.add(current);
|
|
12441
|
+
seen.add(current);
|
|
12426
12442
|
const def = current._def;
|
|
12427
12443
|
let result;
|
|
12428
12444
|
switch (def.tag) {
|
|
@@ -12437,11 +12453,11 @@ var Encoder = class {
|
|
|
12437
12453
|
const name = current._ruleName;
|
|
12438
12454
|
const resolvedWinner = name === void 0 ? void 0 : this.winners?.[name];
|
|
12439
12455
|
if (resolvedWinner !== void 0 && !winnerWrapsReference2(resolvedWinner, current)) {
|
|
12440
|
-
result = hasSideWriter(resolvedWinner
|
|
12456
|
+
result = hasSideWriter(resolvedWinner);
|
|
12441
12457
|
break;
|
|
12442
12458
|
}
|
|
12443
12459
|
try {
|
|
12444
|
-
result = hasSideWriter(def.thunk()
|
|
12460
|
+
result = hasSideWriter(def.thunk());
|
|
12445
12461
|
} catch {
|
|
12446
12462
|
result = { found: true, complete: true };
|
|
12447
12463
|
}
|
|
@@ -12451,7 +12467,7 @@ var Encoder = class {
|
|
|
12451
12467
|
let complete = true;
|
|
12452
12468
|
result = { found: false, complete: true };
|
|
12453
12469
|
for (const child of childrenOf(def)) {
|
|
12454
|
-
const childResult = hasSideWriter(child
|
|
12470
|
+
const childResult = hasSideWriter(child);
|
|
12455
12471
|
if (childResult.found) {
|
|
12456
12472
|
result = { found: true, complete: true };
|
|
12457
12473
|
break;
|
|
@@ -12461,6 +12477,7 @@ var Encoder = class {
|
|
|
12461
12477
|
if (!result.found) result = { found: false, complete };
|
|
12462
12478
|
}
|
|
12463
12479
|
}
|
|
12480
|
+
seen.delete(current);
|
|
12464
12481
|
if (result.found || result.complete) sideWriterMemo.set(current, result.found);
|
|
12465
12482
|
return result;
|
|
12466
12483
|
};
|