clarity-pattern-parser 10.1.12 → 10.1.14
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 +1 -17
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +1 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/patterns/Options.d.ts +0 -1
- package/package.json +1 -1
- package/src/intellisense/javascript/Javascript.test.ts +1 -3
- package/src/patterns/Options.ts +1 -24
package/dist/index.browser.js
CHANGED
|
@@ -1027,17 +1027,12 @@
|
|
|
1027
1027
|
return null;
|
|
1028
1028
|
}
|
|
1029
1029
|
_tryToParse(cursor) {
|
|
1030
|
-
const shouldReverseOrder = this._shouldReverseOrder();
|
|
1031
|
-
let children = this._children;
|
|
1032
|
-
if (shouldReverseOrder) {
|
|
1033
|
-
children = this._children.slice().reverse();
|
|
1034
|
-
}
|
|
1035
1030
|
if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
|
|
1036
1031
|
cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
|
|
1037
1032
|
return null;
|
|
1038
1033
|
}
|
|
1039
1034
|
const results = [];
|
|
1040
|
-
for (const pattern of
|
|
1035
|
+
for (const pattern of this._children) {
|
|
1041
1036
|
cursor.moveTo(this._firstIndex);
|
|
1042
1037
|
let result = null;
|
|
1043
1038
|
result = pattern.parse(cursor);
|
|
@@ -1053,17 +1048,6 @@
|
|
|
1053
1048
|
nonNullResults.sort((a, b) => b.endIndex - a.endIndex);
|
|
1054
1049
|
return nonNullResults[0] || null;
|
|
1055
1050
|
}
|
|
1056
|
-
_shouldReverseOrder() {
|
|
1057
|
-
let count = 0;
|
|
1058
|
-
let pattern = this._parent;
|
|
1059
|
-
while (pattern != null) {
|
|
1060
|
-
if (pattern.id === this.id) {
|
|
1061
|
-
count++;
|
|
1062
|
-
}
|
|
1063
|
-
pattern = pattern.parent;
|
|
1064
|
-
}
|
|
1065
|
-
return count % 2 === 0;
|
|
1066
|
-
}
|
|
1067
1051
|
getTokens() {
|
|
1068
1052
|
const tokens = [];
|
|
1069
1053
|
for (const child of this._children) {
|