clarity-pattern-parser 10.1.4 → 10.1.6

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
@@ -842,14 +842,14 @@ class Reference {
842
842
  continue;
843
843
  }
844
844
  const foundPattern = pattern.getPatternWithinContext(this.name);
845
- if (foundPattern != null) {
845
+ if (foundPattern != null && foundPattern.type !== "reference") {
846
846
  return foundPattern;
847
847
  }
848
848
  pattern = pattern.parent;
849
849
  }
850
850
  const root = this._getRoot();
851
851
  return findPattern(root, (pattern) => {
852
- return pattern.name === this._name && pattern.type !== "reference" && pattern.type !== "context";
852
+ return pattern.name === this._name && pattern.type !== "reference";
853
853
  });
854
854
  }
855
855
  _getRoot() {