parseman 0.55.2 → 0.55.3

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/version.d.ts CHANGED
@@ -13,5 +13,5 @@
13
13
  * Kept in sync with `package.json` by `test/unit/version-sync.test.ts`, which fails
14
14
  * the build if this constant drifts from the published version.
15
15
  */
16
- export declare const PARSEMAN_VERSION = "0.55.2";
16
+ export declare const PARSEMAN_VERSION = "0.55.3";
17
17
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parseman",
3
- "version": "0.55.2",
3
+ "version": "0.55.3",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "engines": {
6
6
  "node": "^20.19.0 || >=22.13.0"
@@ -128,8 +128,7 @@ export function choice<T extends [Combinator<unknown> | GatedArm<unknown>, ...(C
128
128
  // could have started here" the in-bounds miss below gives. Falling through to
129
129
  // firstMatch instead made this position the ONE place a gated-off arm was
130
130
  // dropped from the report — firstMatch `continue`s past it and contributes
131
- // nothing — while the in-bounds miss runs `parsers.flatMap` ignoring gates and
132
- // DOES name it. Same gate state, same "no arm can match", two different
131
+ // nothing — while the in-bounds miss names every arm, gates ignored. Same gate state, same "no arm can match", two different
133
132
  // answers; codegen and both table drivers only ever gave the union. Accept and
134
133
  // reject are untouched: every arm fails at EOF on either path.
135
134
  if (disjoint) {
@@ -154,14 +153,13 @@ export function choice<T extends [Combinator<unknown> | GatedArm<unknown>, ...(C
154
153
  if (result.committed) return { ok: false, expected, span: { start: pos, end: pos }, committed: true }
155
154
  return { ok: false, expected, span: { start: pos, end: pos } }
156
155
  }
157
- return {
158
- ok: false,
159
- expected: parsers.flatMap(p => {
160
- const r = p.parse(input, pos, ctx)
161
- return r.ok ? [] : r.expected
162
- }),
163
- span: { start: pos, end: pos },
164
- }
156
+ // No arm's first set holds this character (or the input has ended), so
157
+ // every arm fails here without reading it. The report is the arms' static
158
+ // expectations: the set this choice's scalar path and both table drivers
159
+ // report for the same miss. A completion probe or recovery sink still sees
160
+ // each arm fail, as it does behind node/attempt/repeat's first-set guards.
161
+ if (ctx._probe !== undefined || ctx._tolerant) for (const p of parsers) p.parse(input, pos, ctx)
162
+ return { ok: false, expected: [...scalarExpected], span: { start: pos, end: pos } }
165
163
  }
166
164
 
167
165
  // ── greedyClassify: run one regex, classify by string equality ─────────
package/src/version.ts CHANGED
@@ -13,4 +13,4 @@
13
13
  * Kept in sync with `package.json` by `test/unit/version-sync.test.ts`, which fails
14
14
  * the build if this constant drifts from the published version.
15
15
  */
16
- export const PARSEMAN_VERSION = '0.55.2'
16
+ export const PARSEMAN_VERSION = '0.55.3'