clarity-pattern-parser 11.0.0 → 11.0.2

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
@@ -2631,7 +2631,6 @@ class Context {
2631
2631
  return Object.assign({}, this._patterns);
2632
2632
  }
2633
2633
  constructor(name, pattern, context = []) {
2634
- this.shouldCompactAst = false;
2635
2634
  this._id = `context-${contextId++}`;
2636
2635
  this._type = "context";
2637
2636
  this._name = name;
@@ -2655,7 +2654,6 @@ class Context {
2655
2654
  clone(name = this._name) {
2656
2655
  const clone = new Context(name, this._pattern, Object.values(this._patterns));
2657
2656
  clone._id = this._id;
2658
- clone.shouldCompactAst = this.shouldCompactAst;
2659
2657
  return clone;
2660
2658
  }
2661
2659
  getTokens() {
@@ -2803,7 +2801,7 @@ class PrecedenceTree {
2803
2801
  _compileAtomNode() {
2804
2802
  let node = this._atomNode;
2805
2803
  if (this._prefixNode != null && this._atomNode != null) {
2806
- node = this._prefixNode;
2804
+ node = this._prefixNode.findRoot();
2807
2805
  this._prefixPlaceholder.replaceWith(this._atomNode);
2808
2806
  }
2809
2807
  if (this._postfixNode != null && node != null) {
@@ -3032,6 +3030,7 @@ class ExpressionPattern {
3032
3030
  cursor.resolveError();
3033
3031
  return node;
3034
3032
  }
3033
+ cursor.moveTo(this._firstIndex);
3035
3034
  cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
3036
3035
  return null;
3037
3036
  }
@@ -3162,8 +3161,8 @@ class ExpressionPattern {
3162
3161
  break;
3163
3162
  }
3164
3163
  else {
3165
- cursor.resolveError();
3166
3164
  cursor.moveTo(onIndex);
3165
+ cursor.resolveError();
3167
3166
  }
3168
3167
  }
3169
3168
  if (!foundMatch) {