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