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
|
@@ -22,7 +22,6 @@ export declare class Options implements Pattern {
|
|
|
22
22
|
exec(text: string, record?: boolean): ParseResult;
|
|
23
23
|
parse(cursor: Cursor): Node | null;
|
|
24
24
|
private _tryToParse;
|
|
25
|
-
private _shouldReverseOrder;
|
|
26
25
|
getTokens(): string[];
|
|
27
26
|
getTokensAfter(_childReference: Pattern): string[];
|
|
28
27
|
getNextTokens(): string[];
|
package/package.json
CHANGED
package/src/patterns/Options.ts
CHANGED
|
@@ -108,16 +108,7 @@ export class Options implements Pattern {
|
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
111
|
private _tryToParse(cursor: Cursor): Node | null {
|
|
114
|
-
const shouldReverseOrder = this._shouldReverseOrder();
|
|
115
|
-
let children = this._children;
|
|
116
|
-
|
|
117
|
-
if (shouldReverseOrder) {
|
|
118
|
-
children = this._children.slice().reverse();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
112
|
if (depthCache.getDepth(this._id, this._firstIndex) > 2) {
|
|
122
113
|
cursor.recordErrorAt(this._firstIndex, this._firstIndex, this);
|
|
123
114
|
return null;
|
|
@@ -125,7 +116,7 @@ export class Options implements Pattern {
|
|
|
125
116
|
|
|
126
117
|
const results: (Node | null)[] = [];
|
|
127
118
|
|
|
128
|
-
for (const pattern of
|
|
119
|
+
for (const pattern of this._children) {
|
|
129
120
|
cursor.moveTo(this._firstIndex);
|
|
130
121
|
let result = null;
|
|
131
122
|
|
|
@@ -148,20 +139,6 @@ export class Options implements Pattern {
|
|
|
148
139
|
return nonNullResults[0] || null;
|
|
149
140
|
}
|
|
150
141
|
|
|
151
|
-
private _shouldReverseOrder() {
|
|
152
|
-
let count = 0;
|
|
153
|
-
let pattern = this._parent;
|
|
154
|
-
|
|
155
|
-
while (pattern != null) {
|
|
156
|
-
if (pattern.id === this.id) {
|
|
157
|
-
count++;
|
|
158
|
-
}
|
|
159
|
-
pattern = pattern.parent;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return count % 2 === 1;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
142
|
getTokens(): string[] {
|
|
166
143
|
const tokens: string[] = [];
|
|
167
144
|
|