clarity-pattern-parser 10.2.10 → 10.2.12

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
@@ -2917,9 +2917,9 @@ class ExpressionPattern {
2917
2917
  cursor.resolveError();
2918
2918
  cursor.moveTo(onIndex);
2919
2919
  }
2920
- cursor.resolveError();
2921
2920
  onIndex = cursor.index;
2922
2921
  for (let i = 0; i < this._binaryPatterns.length; i++) {
2922
+ cursor.resolveError();
2923
2923
  cursor.moveTo(onIndex);
2924
2924
  const pattern = this._binaryPatterns[i];
2925
2925
  const name = this._binaryNames[i];
@@ -2941,7 +2941,7 @@ class ExpressionPattern {
2941
2941
  }
2942
2942
  else if (lastBinaryNode != null && lastUnaryNode != null && delimiterNode != null) {
2943
2943
  const precedence = this._precedenceMap[name];
2944
- const lastPrecendece = lastBinaryNode == null ? 0 : this._precedenceMap[lastBinaryNode.name] || -1;
2944
+ const lastPrecendece = lastBinaryNode == null ? 0 : this._precedenceMap[lastBinaryNode.name] == null ? -1 : this._precedenceMap[lastBinaryNode.name];
2945
2945
  const association = this._binaryAssociation[i];
2946
2946
  if (precedence === lastPrecendece && association === Association.right) {
2947
2947
  const node = createNode(name, [lastUnaryNode, delimiterNode]);