clarity-pattern-parser 10.1.8 → 10.1.9

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
@@ -1021,12 +1021,16 @@ class Options {
1021
1021
  return null;
1022
1022
  }
1023
1023
  _tryToParse(cursor) {
1024
- if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
1024
+ let children = this._children;
1025
+ if (depthCache$1.getDepth(this._id, this._firstIndex) > 1) {
1026
+ children = this._children.reverse();
1027
+ }
1028
+ else if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
1025
1029
  cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
1026
1030
  return null;
1027
1031
  }
1028
1032
  const results = [];
1029
- for (const pattern of this._children) {
1033
+ for (const pattern of children) {
1030
1034
  cursor.moveTo(this._firstIndex);
1031
1035
  let result = null;
1032
1036
  result = pattern.parse(cursor);