parseman 0.55.3 → 0.55.4

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/cli/index.js CHANGED
@@ -14640,7 +14640,8 @@ function tableRules(source, metadataOrEntry = {}) {
14640
14640
  scanSkipFor: (ri, ctx) => {
14641
14641
  const a = cache.forCtx(ctx);
14642
14642
  selected = a;
14643
- return a.scanSkip[skipOf?.[ri] ?? -1];
14643
+ const slot = skipOf?.[ri];
14644
+ return slot === void 0 || slot < 0 ? void 0 : a.scanSkip[slot];
14644
14645
  }
14645
14646
  }, artifactMetadata, resolved);
14646
14647
  if (entry === void 0) return map;
@@ -17553,8 +17554,11 @@ function compileImpl(combinator, mapFnSources, opts = {}) {
17553
17554
  // falls back to regex-scanning generated hooks; a table has no hooks to scan,
17554
17555
  // so this is the channel.
17555
17556
  ...plan === void 0 ? {} : { coverageDefinitions: plan.definitions },
17556
- parse(input, pos = 0) {
17557
- return runOnce(input, pos, createParseContext());
17557
+ // The same three arguments as a combinator's own `parse`, so a compiled
17558
+ // parser runs where a combinator does. A caller probing many positions
17559
+ // passes one context and pays for none per call.
17560
+ parse(input, pos = 0, ctx) {
17561
+ return runOnce(input, pos, ctx ?? createParseContext());
17558
17562
  },
17559
17563
  parseWithContext(input, parseCtx, pos = 0) {
17560
17564
  return runOnce(input, pos, parseCtx);