clarity-pattern-parser 10.2.1 → 10.2.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/package.json
CHANGED
|
@@ -144,11 +144,11 @@ export class ExpressionPattern implements Pattern {
|
|
|
144
144
|
|
|
145
145
|
private _isBinaryPattern(pattern: Pattern) {
|
|
146
146
|
return pattern.type === "sequence" &&
|
|
147
|
+
pattern.children.length === 3 &&
|
|
147
148
|
pattern.children[0].type === "reference" &&
|
|
148
149
|
pattern.children[0].name === this.name &&
|
|
149
150
|
pattern.children[2].type === "reference" &&
|
|
150
|
-
pattern.children[2].name === this.name
|
|
151
|
-
pattern.children.length === 3;
|
|
151
|
+
pattern.children[2].name === this.name;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
private _extractDelimiter(pattern: Pattern) {
|
|
@@ -313,10 +313,10 @@ export class ExpressionPattern implements Pattern {
|
|
|
313
313
|
let ancestor = lastBinaryNode.parent;
|
|
314
314
|
let root: Node | null = lastBinaryNode;
|
|
315
315
|
|
|
316
|
-
while(ancestor != null){
|
|
316
|
+
while (ancestor != null) {
|
|
317
317
|
const nodePrecedence = this._precedenceMap[ancestor.name];
|
|
318
318
|
|
|
319
|
-
if (nodePrecedence > precedence){
|
|
319
|
+
if (nodePrecedence > precedence) {
|
|
320
320
|
break;
|
|
321
321
|
}
|
|
322
322
|
root = ancestor;
|
|
@@ -329,7 +329,7 @@ export class ExpressionPattern implements Pattern {
|
|
|
329
329
|
const node = createNode(name, []);
|
|
330
330
|
root.replaceWith(node);
|
|
331
331
|
node.append(root, delimiterNode);
|
|
332
|
-
|
|
332
|
+
|
|
333
333
|
lastBinaryNode = node;
|
|
334
334
|
} else {
|
|
335
335
|
const node = createNode(name, [lastUnaryNode, delimiterNode]);
|
|
@@ -353,7 +353,7 @@ export class ExpressionPattern implements Pattern {
|
|
|
353
353
|
break;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
if (lastBinaryNode == null){
|
|
356
|
+
if (lastBinaryNode == null) {
|
|
357
357
|
break;
|
|
358
358
|
}
|
|
359
359
|
}
|