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.
@@ -3607,7 +3607,7 @@
3607
3607
  const isNot = n.find(n => n.name === "not") != null;
3608
3608
  const isOptional = n.find(n => n.name === "is-optional");
3609
3609
  const pattern = this._buildPattern(patternNode);
3610
- const finalPattern = isOptional ? new Optional(pattern.name, pattern) : pattern;
3610
+ const finalPattern = isOptional ? new Optional(`optional-${pattern.name}`, pattern) : pattern;
3611
3611
  if (isNot) {
3612
3612
  return new Not(`not-${finalPattern.name}`, finalPattern);
3613
3613
  }
@@ -3666,7 +3666,7 @@
3666
3666
  isOptional = true;
3667
3667
  }
3668
3668
  }
3669
- return isOptional ? new Optional(name, new Repeat(name, pattern, options)) : new Repeat(name, pattern, options);
3669
+ return isOptional ? new Optional(name, new Repeat(`inner-optional-${name}`, pattern, options)) : new Repeat(name, pattern, options);
3670
3670
  }
3671
3671
  _saveConfigurableAnonymous(node) {
3672
3672
  const nameNode = node.find(n => n.name === "name");