clarity-pattern-parser 10.2.0 → 10.2.1
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.browser.js +13 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +13 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/patterns/ExpressionPattern.test.ts +11 -11
- package/src/patterns/ExpressionPattern.ts +17 -2
package/dist/index.esm.js
CHANGED
|
@@ -2924,10 +2924,21 @@ class ExpressionPattern {
|
|
|
2924
2924
|
lastBinaryNode = node;
|
|
2925
2925
|
}
|
|
2926
2926
|
else if (precedence > lastPrecendece) {
|
|
2927
|
-
|
|
2927
|
+
let ancestor = lastBinaryNode.parent;
|
|
2928
|
+
let root = lastBinaryNode;
|
|
2929
|
+
while (ancestor != null) {
|
|
2930
|
+
const nodePrecedence = this._precedenceMap[ancestor.name];
|
|
2931
|
+
if (nodePrecedence > precedence) {
|
|
2932
|
+
break;
|
|
2933
|
+
}
|
|
2934
|
+
root = ancestor;
|
|
2935
|
+
ancestor = ancestor.parent;
|
|
2936
|
+
}
|
|
2928
2937
|
lastBinaryNode.appendChild(lastUnaryNode);
|
|
2929
2938
|
if (root != null) {
|
|
2930
|
-
const node = createNode(name, [
|
|
2939
|
+
const node = createNode(name, []);
|
|
2940
|
+
root.replaceWith(node);
|
|
2941
|
+
node.append(root, delimiterNode);
|
|
2931
2942
|
lastBinaryNode = node;
|
|
2932
2943
|
}
|
|
2933
2944
|
else {
|