parseman 0.51.0 → 0.51.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/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.51.0";
16
+ export declare const PARSEMAN_VERSION = "0.51.1";
17
17
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parseman",
3
- "version": "0.51.0",
3
+ "version": "0.51.1",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "engines": {
6
6
  "node": "^20.19.0 || >=22.13.0"
@@ -101,7 +101,7 @@ const ruleNameOf = (c: Comb): string | undefined =>
101
101
  * the serializer treats it as an atom: it is not descended for sharing/recursion
102
102
  * analysis (the interior's `self` ref is internal and must not surface as a cycle).
103
103
  */
104
- const balancedOf = (c: Comb): { open: string; close: string; ownSkip: Comb[] } | undefined =>
104
+ const balancedOf = (c: Comb): { open: string; close: string; ownSkip: Comb[]; strict?: boolean } | undefined =>
105
105
  (c as BalancedAmbient)._balancedAmbient
106
106
 
107
107
  /** Resolve a lazy's target, or null if it isn't defined yet (external ref). */
@@ -505,8 +505,12 @@ class Serializer {
505
505
  // which is correct — they opt out of ambient resolution by definition.
506
506
  const bal = balancedOf(c)
507
507
  if (bal) {
508
- const skipArg = bal.ownSkip.length === 0 ? '' : `, { skip: [${bal.ownSkip.map(kid).join(', ')}] }`
509
- return `balanced(${JSON.stringify(bal.open)}, ${JSON.stringify(bal.close)}${skipArg})`
508
+ const options = [
509
+ ...(bal.ownSkip.length === 0 ? [] : [`skip: [${bal.ownSkip.map(kid).join(', ')}]`]),
510
+ ...(bal.strict ? ['strict: true'] : []),
511
+ ]
512
+ const optionsArg = options.length === 0 ? '' : `, { ${options.join(', ')} }`
513
+ return `balanced(${JSON.stringify(bal.open)}, ${JSON.stringify(bal.close)}${optionsArg})`
510
514
  }
511
515
  switch (def.tag) {
512
516
  case 'lazy': {
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.51.0'
16
+ export const PARSEMAN_VERSION = '0.51.1'