clarity-pattern-parser 10.1.13 → 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.js
CHANGED
|
@@ -1025,17 +1025,12 @@ class Options {
|
|
|
1025
1025
|
return null;
|
|
1026
1026
|
}
|
|
1027
1027
|
_tryToParse(cursor) {
|
|
1028
|
-
const shouldReverseOrder = this._shouldReverseOrder();
|
|
1029
|
-
let children = this._children;
|
|
1030
|
-
if (shouldReverseOrder) {
|
|
1031
|
-
children = this._children.slice().reverse();
|
|
1032
|
-
}
|
|
1033
1028
|
if (depthCache$1.getDepth(this._id, this._firstIndex) > 2) {
|
|
1034
1029
|
cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
|
|
1035
1030
|
return null;
|
|
1036
1031
|
}
|
|
1037
1032
|
const results = [];
|
|
1038
|
-
for (const pattern of
|
|
1033
|
+
for (const pattern of this._children) {
|
|
1039
1034
|
cursor.moveTo(this._firstIndex);
|
|
1040
1035
|
let result = null;
|
|
1041
1036
|
result = pattern.parse(cursor);
|
|
@@ -1051,17 +1046,6 @@ class Options {
|
|
|
1051
1046
|
nonNullResults.sort((a, b) => b.endIndex - a.endIndex);
|
|
1052
1047
|
return nonNullResults[0] || null;
|
|
1053
1048
|
}
|
|
1054
|
-
_shouldReverseOrder() {
|
|
1055
|
-
let count = 0;
|
|
1056
|
-
let pattern = this._parent;
|
|
1057
|
-
while (pattern != null) {
|
|
1058
|
-
if (pattern.id === this.id) {
|
|
1059
|
-
count++;
|
|
1060
|
-
}
|
|
1061
|
-
pattern = pattern.parent;
|
|
1062
|
-
}
|
|
1063
|
-
return count % 2 === 1;
|
|
1064
|
-
}
|
|
1065
1049
|
getTokens() {
|
|
1066
1050
|
const tokens = [];
|
|
1067
1051
|
for (const child of this._children) {
|