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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-pattern-parser",
3
- "version": "10.1.13",
3
+ "version": "10.1.14",
4
4
  "description": "Parsing Library for Typescript and Javascript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -220,6 +220,4 @@ describe("Ecmascript 3", () => {
220
220
  result = expression.exec(`name.prop.anotherProp["Ha"][coolYo] === 1`);
221
221
  expect(result.ast?.value).toBe(`name.prop.anotherProp["Ha"][coolYo] === 1`);
222
222
  });
223
-
224
-
225
- });
223
+ });
@@ -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 children) {
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