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.esm.js
CHANGED
|
@@ -646,7 +646,7 @@ class Regex {
|
|
|
646
646
|
get name() {
|
|
647
647
|
return this._name;
|
|
648
648
|
}
|
|
649
|
-
get
|
|
649
|
+
get regex() {
|
|
650
650
|
return this._originalRegexString;
|
|
651
651
|
}
|
|
652
652
|
get parent() {
|
|
@@ -1101,6 +1101,7 @@ class FiniteRepeat {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
1103
|
parse(cursor) {
|
|
1104
|
+
var _a;
|
|
1104
1105
|
cursor.startParseWith(this);
|
|
1105
1106
|
const startIndex = cursor.index;
|
|
1106
1107
|
const nodes = [];
|
|
@@ -1130,7 +1131,7 @@ class FiniteRepeat {
|
|
|
1130
1131
|
}
|
|
1131
1132
|
}
|
|
1132
1133
|
if (this._trimDivider && this._hasDivider) {
|
|
1133
|
-
const isDividerLastMatch = cursor.leafMatch.pattern === this.children[1];
|
|
1134
|
+
const isDividerLastMatch = ((_a = cursor.leafMatch.pattern) === null || _a === void 0 ? void 0 : _a.id) === this.children[1].id;
|
|
1134
1135
|
if (isDividerLastMatch) {
|
|
1135
1136
|
const node = nodes.pop();
|
|
1136
1137
|
cursor.moveTo(node.firstIndex);
|
|
@@ -1371,7 +1372,7 @@ class InfiniteRepeat {
|
|
|
1371
1372
|
else {
|
|
1372
1373
|
if (dividerNode == null) {
|
|
1373
1374
|
cursor.moveTo(dividerStartIndex);
|
|
1374
|
-
if (
|
|
1375
|
+
if (repeatNode == null) {
|
|
1375
1376
|
// If neither the repeat pattern or divider pattern matched get out.
|
|
1376
1377
|
passed = true;
|
|
1377
1378
|
break;
|