clarity-pattern-parser 10.0.1 → 10.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.browser.js +3 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +3 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/patterns/FiniteRepeat.ts +1 -1
- package/src/patterns/InfiniteRepeat.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1105,6 +1105,7 @@ class FiniteRepeat {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
1107
|
parse(cursor) {
|
|
1108
|
+
var _a;
|
|
1108
1109
|
cursor.startParseWith(this);
|
|
1109
1110
|
const startIndex = cursor.index;
|
|
1110
1111
|
const nodes = [];
|
|
@@ -1134,7 +1135,7 @@ class FiniteRepeat {
|
|
|
1134
1135
|
}
|
|
1135
1136
|
}
|
|
1136
1137
|
if (this._trimDivider && this._hasDivider) {
|
|
1137
|
-
const isDividerLastMatch = cursor.leafMatch.pattern === this.children[1];
|
|
1138
|
+
const isDividerLastMatch = ((_a = cursor.leafMatch.pattern) === null || _a === void 0 ? void 0 : _a.id) === this.children[1].id;
|
|
1138
1139
|
if (isDividerLastMatch) {
|
|
1139
1140
|
const node = nodes.pop();
|
|
1140
1141
|
cursor.moveTo(node.firstIndex);
|
|
@@ -1375,7 +1376,7 @@ class InfiniteRepeat {
|
|
|
1375
1376
|
else {
|
|
1376
1377
|
if (dividerNode == null) {
|
|
1377
1378
|
cursor.moveTo(dividerStartIndex);
|
|
1378
|
-
if (
|
|
1379
|
+
if (repeatNode == null) {
|
|
1379
1380
|
// If neither the repeat pattern or divider pattern matched get out.
|
|
1380
1381
|
passed = true;
|
|
1381
1382
|
break;
|