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.js CHANGED
@@ -2635,7 +2635,6 @@ class Context {
2635
2635
  return Object.assign({}, this._patterns);
2636
2636
  }
2637
2637
  constructor(name, pattern, context = []) {
2638
- this.shouldCompactAst = false;
2639
2638
  this._id = `context-${contextId++}`;
2640
2639
  this._type = "context";
2641
2640
  this._name = name;
@@ -2659,7 +2658,6 @@ class Context {
2659
2658
  clone(name = this._name) {
2660
2659
  const clone = new Context(name, this._pattern, Object.values(this._patterns));
2661
2660
  clone._id = this._id;
2662
- clone.shouldCompactAst = this.shouldCompactAst;
2663
2661
  return clone;
2664
2662
  }
2665
2663
  getTokens() {
@@ -2807,7 +2805,7 @@ class PrecedenceTree {
2807
2805
  _compileAtomNode() {
2808
2806
  let node = this._atomNode;
2809
2807
  if (this._prefixNode != null && this._atomNode != null) {
2810
- node = this._prefixNode;
2808
+ node = this._prefixNode.findRoot();
2811
2809
  this._prefixPlaceholder.replaceWith(this._atomNode);
2812
2810
  }
2813
2811
  if (this._postfixNode != null && node != null) {
@@ -3036,6 +3034,7 @@ class ExpressionPattern {
3036
3034
  cursor.resolveError();
3037
3035
  return node;
3038
3036
  }
3037
+ cursor.moveTo(this._firstIndex);
3039
3038
  cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
3040
3039
  return null;
3041
3040
  }
@@ -3166,8 +3165,8 @@ class ExpressionPattern {
3166
3165
  break;
3167
3166
  }
3168
3167
  else {
3169
- cursor.resolveError();
3170
3168
  cursor.moveTo(onIndex);
3169
+ cursor.resolveError();
3171
3170
  }
3172
3171
  }
3173
3172
  if (!foundMatch) {