clarity-pattern-parser 10.0.0 → 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 +4 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/patterns/Regex.d.ts +1 -1
- package/package.json +1 -1
- package/src/patterns/FiniteRepeat.ts +1 -1
- package/src/patterns/InfiniteRepeat.ts +1 -1
- package/src/patterns/Regex.ts +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -652,7 +652,7 @@
|
|
|
652
652
|
get name() {
|
|
653
653
|
return this._name;
|
|
654
654
|
}
|
|
655
|
-
get
|
|
655
|
+
get regex() {
|
|
656
656
|
return this._originalRegexString;
|
|
657
657
|
}
|
|
658
658
|
get parent() {
|
|
@@ -1107,6 +1107,7 @@
|
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
1109
|
parse(cursor) {
|
|
1110
|
+
var _a;
|
|
1110
1111
|
cursor.startParseWith(this);
|
|
1111
1112
|
const startIndex = cursor.index;
|
|
1112
1113
|
const nodes = [];
|
|
@@ -1136,7 +1137,7 @@
|
|
|
1136
1137
|
}
|
|
1137
1138
|
}
|
|
1138
1139
|
if (this._trimDivider && this._hasDivider) {
|
|
1139
|
-
const isDividerLastMatch = cursor.leafMatch.pattern === this.children[1];
|
|
1140
|
+
const isDividerLastMatch = ((_a = cursor.leafMatch.pattern) === null || _a === void 0 ? void 0 : _a.id) === this.children[1].id;
|
|
1140
1141
|
if (isDividerLastMatch) {
|
|
1141
1142
|
const node = nodes.pop();
|
|
1142
1143
|
cursor.moveTo(node.firstIndex);
|
|
@@ -1377,7 +1378,7 @@
|
|
|
1377
1378
|
else {
|
|
1378
1379
|
if (dividerNode == null) {
|
|
1379
1380
|
cursor.moveTo(dividerStartIndex);
|
|
1380
|
-
if (
|
|
1381
|
+
if (repeatNode == null) {
|
|
1381
1382
|
// If neither the repeat pattern or divider pattern matched get out.
|
|
1382
1383
|
passed = true;
|
|
1383
1384
|
break;
|