clarity-pattern-parser 11.0.12 → 11.0.14

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/index.esm.js CHANGED
@@ -3601,7 +3601,7 @@ class Grammar {
3601
3601
  const isNot = n.find(n => n.name === "not") != null;
3602
3602
  const isOptional = n.find(n => n.name === "is-optional");
3603
3603
  const pattern = this._buildPattern(patternNode);
3604
- const finalPattern = isOptional ? new Optional(pattern.name, pattern) : pattern;
3604
+ const finalPattern = isOptional ? new Optional(`optional-${pattern.name}`, pattern) : pattern;
3605
3605
  if (isNot) {
3606
3606
  return new Not(`not-${finalPattern.name}`, finalPattern);
3607
3607
  }
@@ -3660,7 +3660,7 @@ class Grammar {
3660
3660
  isOptional = true;
3661
3661
  }
3662
3662
  }
3663
- return isOptional ? new Optional(name, new Repeat(name, pattern, options)) : new Repeat(name, pattern, options);
3663
+ return isOptional ? new Optional(name, new Repeat(`inner-optional-${name}`, pattern, options)) : new Repeat(name, pattern, options);
3664
3664
  }
3665
3665
  _saveConfigurableAnonymous(node) {
3666
3666
  const nameNode = node.find(n => n.name === "name");