parseman 0.55.2 → 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/analysis/diagnostics.js +9 -11
- package/dist/analysis/diagnostics.js.map +1 -1
- package/dist/cli/index.js +9 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/combinators/choice.d.ts.map +1 -1
- package/dist/index.js +10 -12
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.js +10 -12
- package/dist/plugin/index.js.map +1 -1
- package/dist/table/exec.d.ts.map +1 -1
- package/dist/table/index.js +9 -11
- package/dist/table/index.js.map +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/combinators/choice.ts +8 -10
- package/src/table/assemble.ts +4 -1
- package/src/table/compile.ts +5 -2
- package/src/table/exec.ts +4 -1
- package/src/types.ts +5 -1
- package/src/version.ts +1 -1
|
@@ -3646,14 +3646,8 @@ function choice(...args) {
|
|
|
3646
3646
|
if (result.committed) return { ok: false, expected, span: { start: pos, end: pos }, committed: true };
|
|
3647
3647
|
return { ok: false, expected, span: { start: pos, end: pos } };
|
|
3648
3648
|
}
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
expected: parsers.flatMap((p) => {
|
|
3652
|
-
const r = p.parse(input, pos, ctx);
|
|
3653
|
-
return r.ok ? [] : r.expected;
|
|
3654
|
-
}),
|
|
3655
|
-
span: { start: pos, end: pos }
|
|
3656
|
-
};
|
|
3649
|
+
if (ctx._probe !== void 0 || ctx._tolerant) for (const p of parsers) p.parse(input, pos, ctx);
|
|
3650
|
+
return { ok: false, expected: [...scalarExpected], span: { start: pos, end: pos } };
|
|
3657
3651
|
}
|
|
3658
3652
|
if (strategy?.tag === "greedyClassify") {
|
|
3659
3653
|
const superResult = parsers[strategy.superIndex].parse(input, pos, ctx);
|
|
@@ -14762,7 +14756,8 @@ function tableRules(source, metadataOrEntry = {}) {
|
|
|
14762
14756
|
scanSkipFor: (ri, ctx) => {
|
|
14763
14757
|
const a = cache.forCtx(ctx);
|
|
14764
14758
|
selected = a;
|
|
14765
|
-
|
|
14759
|
+
const slot = skipOf?.[ri];
|
|
14760
|
+
return slot === void 0 || slot < 0 ? void 0 : a.scanSkip[slot];
|
|
14766
14761
|
}
|
|
14767
14762
|
}, artifactMetadata, resolved);
|
|
14768
14763
|
if (entry === void 0) return map;
|
|
@@ -16712,8 +16707,11 @@ function compileImpl(combinator, mapFnSources, opts = {}) {
|
|
|
16712
16707
|
// falls back to regex-scanning generated hooks; a table has no hooks to scan,
|
|
16713
16708
|
// so this is the channel.
|
|
16714
16709
|
...plan === void 0 ? {} : { coverageDefinitions: plan.definitions },
|
|
16715
|
-
parse
|
|
16716
|
-
|
|
16710
|
+
// The same three arguments as a combinator's own `parse`, so a compiled
|
|
16711
|
+
// parser runs where a combinator does. A caller probing many positions
|
|
16712
|
+
// passes one context and pays for none per call.
|
|
16713
|
+
parse(input, pos = 0, ctx) {
|
|
16714
|
+
return runOnce(input, pos, ctx ?? createParseContext());
|
|
16717
16715
|
},
|
|
16718
16716
|
parseWithContext(input, parseCtx, pos = 0) {
|
|
16719
16717
|
return runOnce(input, pos, parseCtx);
|