clarity-pattern-parser 10.1.8 → 10.1.10

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.
@@ -1027,12 +1027,16 @@
1027
1027
  return null;
1028
1028
  }
1029
1029
  _tryToParse(cursor) {
1030
+ let children = this._children;
1030
1031
  if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
1032
+ children = this._children.filter(c => c.type === "regex" || c.type === "literal");
1033
+ }
1034
+ else if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
1031
1035
  cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
1032
1036
  return null;
1033
1037
  }
1034
1038
  const results = [];
1035
- for (const pattern of this._children) {
1039
+ for (const pattern of children) {
1036
1040
  cursor.moveTo(this._firstIndex);
1037
1041
  let result = null;
1038
1042
  result = pattern.parse(cursor);