clarity-pattern-parser 10.2.7 → 10.2.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
@@ -2888,11 +2888,11 @@ class ExpressionPattern {
2888
2888
  const pattern = this._recursivePatterns[i];
2889
2889
  const node = pattern.parse(cursor);
2890
2890
  if (node != null) {
2891
- if (lastBinaryNode != null && lastUnaryNode != null) {
2892
- lastBinaryNode.appendChild(lastUnaryNode);
2893
- }
2894
2891
  const name = this._recursiveNames[i];
2895
2892
  if (this._endsInRecursion[i]) {
2893
+ if (lastBinaryNode != null && lastUnaryNode != null) {
2894
+ lastBinaryNode.appendChild(lastUnaryNode);
2895
+ }
2896
2896
  const frontExpression = lastBinaryNode == null ? lastUnaryNode : lastBinaryNode.findRoot();
2897
2897
  const recursiveNode = createNode(name, [frontExpression, ...node.children]);
2898
2898
  recursiveNode.normalize(this._firstIndex);
@@ -2905,6 +2905,12 @@ class ExpressionPattern {
2905
2905
  if (cursor.hasNext()) {
2906
2906
  cursor.next();
2907
2907
  }
2908
+ else {
2909
+ if (lastBinaryNode != null) {
2910
+ lastBinaryNode.appendChild(lastUnaryNode);
2911
+ }
2912
+ break outer;
2913
+ }
2908
2914
  break;
2909
2915
  }
2910
2916
  }