clarity-pattern-parser 10.1.13 → 10.1.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.esm.js CHANGED
@@ -1021,17 +1021,12 @@ class Options {
1021
1021
  return null;
1022
1022
  }
1023
1023
  _tryToParse(cursor) {
1024
- const shouldReverseOrder = this._shouldReverseOrder();
1025
- let children = this._children;
1026
- if (shouldReverseOrder) {
1027
- children = this._children.slice().reverse();
1028
- }
1029
1024
  if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
1030
1025
  cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
1031
1026
  return null;
1032
1027
  }
1033
1028
  const results = [];
1034
- for (const pattern of children) {
1029
+ for (const pattern of this._children) {
1035
1030
  cursor.moveTo(this._firstIndex);
1036
1031
  let result = null;
1037
1032
  result = pattern.parse(cursor);
@@ -1047,17 +1042,6 @@ class Options {
1047
1042
  nonNullResults.sort((a, b) => b.endIndex - a.endIndex);
1048
1043
  return nonNullResults[0] || null;
1049
1044
  }
1050
- _shouldReverseOrder() {
1051
- let count = 0;
1052
- let pattern = this._parent;
1053
- while (pattern != null) {
1054
- if (pattern.id === this.id) {
1055
- count++;
1056
- }
1057
- pattern = pattern.parent;
1058
- }
1059
- return count % 2 === 1;
1060
- }
1061
1045
  getTokens() {
1062
1046
  const tokens = [];
1063
1047
  for (const child of this._children) {