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.
@@ -1027,17 +1027,12 @@
1027
1027
  return null;
1028
1028
  }
1029
1029
  _tryToParse(cursor) {
1030
- const shouldReverseOrder = this._shouldReverseOrder();
1031
- let children = this._children;
1032
- if (shouldReverseOrder) {
1033
- children = this._children.slice().reverse();
1034
- }
1035
1030
  if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
1036
1031
  cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
1037
1032
  return null;
1038
1033
  }
1039
1034
  const results = [];
1040
- for (const pattern of children) {
1035
+ for (const pattern of this._children) {
1041
1036
  cursor.moveTo(this._firstIndex);
1042
1037
  let result = null;
1043
1038
  result = pattern.parse(cursor);
@@ -1053,17 +1048,6 @@
1053
1048
  nonNullResults.sort((a, b) => b.endIndex - a.endIndex);
1054
1049
  return nonNullResults[0] || null;
1055
1050
  }
1056
- _shouldReverseOrder() {
1057
- let count = 0;
1058
- let pattern = this._parent;
1059
- while (pattern != null) {
1060
- if (pattern.id === this.id) {
1061
- count++;
1062
- }
1063
- pattern = pattern.parent;
1064
- }
1065
- return count % 2 === 1;
1066
- }
1067
1051
  getTokens() {
1068
1052
  const tokens = [];
1069
1053
  for (const child of this._children) {