@willbooster/web-tree-sitter 19.1.1 → 20.0.0
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/README.md +0 -20
- package/debug/web-tree-sitter.cjs +14 -231
- package/debug/web-tree-sitter.cjs.map +3 -3
- package/debug/web-tree-sitter.js +14 -230
- package/debug/web-tree-sitter.js.map +3 -3
- package/debug/web-tree-sitter.wasm +0 -0
- package/debug/web-tree-sitter.wasm.map +17 -21
- package/package.json +1 -2
- package/web-tree-sitter.cjs +3 -3
- package/web-tree-sitter.cjs.map +4 -4
- package/web-tree-sitter.d.cts +2 -86
- package/web-tree-sitter.d.cts.map +1 -4
- package/web-tree-sitter.d.ts +2 -86
- package/web-tree-sitter.d.ts.map +1 -4
- package/web-tree-sitter.js +3 -3
- package/web-tree-sitter.js.map +4 -4
- package/web-tree-sitter.wasm +0 -0
- package/web-tree-sitter.wasm.map +22 -26
- package/web-tree-sitter.web.js +3 -3
- package/web-tree-sitter.web.js.map +4 -4
package/web-tree-sitter.d.cts
CHANGED
|
@@ -48,47 +48,6 @@
|
|
|
48
48
|
/** The memory imported by `web-tree-sitter.wasm`. */
|
|
49
49
|
wasmMemory?: WebAssembly.Memory;
|
|
50
50
|
}
|
|
51
|
-
export class Edit {
|
|
52
|
-
/** The start position of the change. */
|
|
53
|
-
startPosition: Point;
|
|
54
|
-
/** The end position of the change before the edit. */
|
|
55
|
-
oldEndPosition: Point;
|
|
56
|
-
/** The end position of the change after the edit. */
|
|
57
|
-
newEndPosition: Point;
|
|
58
|
-
/** The start index of the change. */
|
|
59
|
-
startIndex: number;
|
|
60
|
-
/** The end index of the change before the edit. */
|
|
61
|
-
oldEndIndex: number;
|
|
62
|
-
/** The end index of the change after the edit. */
|
|
63
|
-
newEndIndex: number;
|
|
64
|
-
constructor({ startIndex, oldEndIndex, newEndIndex, startPosition, oldEndPosition, newEndPosition, }: {
|
|
65
|
-
startIndex: number;
|
|
66
|
-
oldEndIndex: number;
|
|
67
|
-
newEndIndex: number;
|
|
68
|
-
startPosition: Point;
|
|
69
|
-
oldEndPosition: Point;
|
|
70
|
-
newEndPosition: Point;
|
|
71
|
-
});
|
|
72
|
-
/**
|
|
73
|
-
* Edit a point and index to keep it in-sync with source code that has been edited.
|
|
74
|
-
*
|
|
75
|
-
* This function updates a single point's byte offset and row/column position
|
|
76
|
-
* based on an edit operation. This is useful for editing points without
|
|
77
|
-
* requiring a tree or node instance.
|
|
78
|
-
*/
|
|
79
|
-
editPoint(point: Point, index: number): {
|
|
80
|
-
point: Point;
|
|
81
|
-
index: number;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Edit a range to keep it in-sync with source code that has been edited.
|
|
85
|
-
*
|
|
86
|
-
* This function updates a range's start and end positions based on an edit
|
|
87
|
-
* operation. This is useful for editing ranges without requiring a tree
|
|
88
|
-
* or node instance.
|
|
89
|
-
*/
|
|
90
|
-
editRange(range: Range): Range;
|
|
91
|
-
}
|
|
92
51
|
/**
|
|
93
52
|
* Options for parsing
|
|
94
53
|
*
|
|
@@ -203,10 +162,6 @@
|
|
|
203
162
|
*
|
|
204
163
|
* @param callback - The UTF8-encoded text to parse or a callback function.
|
|
205
164
|
*
|
|
206
|
-
* @param oldTree - A previous syntax tree parsed from the same document. If the text of the
|
|
207
|
-
* document has changed since `oldTree` was created, then you must edit `oldTree` to match
|
|
208
|
-
* the new text using {@link Tree#edit}.
|
|
209
|
-
*
|
|
210
165
|
* @param options - Options for parsing the text.
|
|
211
166
|
* This can be used to set the included ranges, or a progress callback.
|
|
212
167
|
*
|
|
@@ -215,7 +170,7 @@
|
|
|
215
170
|
* - The progress callback returned true.
|
|
216
171
|
* - The memory limit was reached or the operation limit was exceeded.
|
|
217
172
|
*/
|
|
218
|
-
parse(callback: string | ParseCallback,
|
|
173
|
+
parse(callback: string | ParseCallback, options?: ParseOptions): Tree | null;
|
|
219
174
|
/**
|
|
220
175
|
* Instruct the parser to start the next parse from the beginning.
|
|
221
176
|
*
|
|
@@ -364,28 +319,8 @@
|
|
|
364
319
|
* forward by the given offset.
|
|
365
320
|
*/
|
|
366
321
|
rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node;
|
|
367
|
-
/**
|
|
368
|
-
* Edit the syntax tree to keep it in sync with source code that has been
|
|
369
|
-
* edited.
|
|
370
|
-
*
|
|
371
|
-
* You must describe the edit both in terms of byte offsets and in terms of
|
|
372
|
-
* row/column coordinates.
|
|
373
|
-
*/
|
|
374
|
-
edit(edit: Edit): void;
|
|
375
322
|
/** Create a new {@link TreeCursor} starting from the root of the tree. */
|
|
376
323
|
walk(): TreeCursor;
|
|
377
|
-
/**
|
|
378
|
-
* Compare this old edited syntax tree to a new syntax tree representing
|
|
379
|
-
* the same document, returning a sequence of ranges whose syntactic
|
|
380
|
-
* structure has changed.
|
|
381
|
-
*
|
|
382
|
-
* For this to work correctly, this syntax tree must have been edited such
|
|
383
|
-
* that its ranges match up to the new tree. Generally, you'll want to
|
|
384
|
-
* call this method right after calling one of the [`Parser::parse`]
|
|
385
|
-
* functions. Call it on the old tree that was passed to parse, and
|
|
386
|
-
* pass the new tree that was returned from `parse`.
|
|
387
|
-
*/
|
|
388
|
-
getChangedRanges(other: Tree): Range[];
|
|
389
324
|
/** Get the included ranges that were used to parse the syntax tree. */
|
|
390
325
|
getIncludedRanges(): Range[];
|
|
391
326
|
}
|
|
@@ -394,14 +329,7 @@
|
|
|
394
329
|
/**
|
|
395
330
|
* The numeric id for this node that is unique.
|
|
396
331
|
*
|
|
397
|
-
* Within a given syntax tree, no two nodes have the same id.
|
|
398
|
-
*
|
|
399
|
-
* * If a new tree is created based on an older tree, and a node from the old tree is reused in
|
|
400
|
-
* the process, then that node will have the same id in both trees.
|
|
401
|
-
*
|
|
402
|
-
* * A node not marked as having changes does not guarantee it was reused.
|
|
403
|
-
*
|
|
404
|
-
* * If a node is marked as having changed in the old tree, it will not be reused.
|
|
332
|
+
* Within a given syntax tree, no two nodes have the same id.
|
|
405
333
|
*/
|
|
406
334
|
id: number;
|
|
407
335
|
/** The byte index where this node starts. */
|
|
@@ -452,8 +380,6 @@
|
|
|
452
380
|
* certain kinds of syntax errors.
|
|
453
381
|
*/
|
|
454
382
|
get isMissing(): boolean;
|
|
455
|
-
/** Check if this node has been edited. */
|
|
456
|
-
get hasChanges(): boolean;
|
|
457
383
|
/**
|
|
458
384
|
* Check if this node represents a syntax error or contains any syntax
|
|
459
385
|
* errors anywhere within it.
|
|
@@ -611,16 +537,6 @@
|
|
|
611
537
|
* and the cursor cannot walk outside this node.
|
|
612
538
|
*/
|
|
613
539
|
walk(): TreeCursor;
|
|
614
|
-
/**
|
|
615
|
-
* Edit this node to keep it in-sync with source code that has been edited.
|
|
616
|
-
*
|
|
617
|
-
* This function is only rarely needed. When you edit a syntax tree with
|
|
618
|
-
* the {@link Tree#edit} method, all of the nodes that you retrieve from
|
|
619
|
-
* the tree afterward will already reflect the edit. You only need to
|
|
620
|
-
* use {@link Node#edit} when you have a specific {@link Node} instance that
|
|
621
|
-
* you want to keep and continue to use after an edit.
|
|
622
|
-
*/
|
|
623
|
-
edit(edit: Edit): void;
|
|
624
540
|
/** Get the S-expression representation of this node. */
|
|
625
541
|
toString(): string;
|
|
626
542
|
}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"ProgressCallback",
|
|
9
9
|
"LogCallback",
|
|
10
10
|
"ParserInitOptions",
|
|
11
|
-
"Edit",
|
|
12
11
|
"ParseOptions",
|
|
13
12
|
"ParseState",
|
|
14
13
|
"LANGUAGE_VERSION",
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
"sources": [
|
|
25
24
|
"src/constants.ts",
|
|
26
25
|
"src/bindings.ts",
|
|
27
|
-
"src/edit.ts",
|
|
28
26
|
"src/parser.ts",
|
|
29
27
|
"src/language.ts",
|
|
30
28
|
"src/tree.ts",
|
|
@@ -40,9 +38,8 @@
|
|
|
40
38
|
null,
|
|
41
39
|
null,
|
|
42
40
|
null,
|
|
43
|
-
null,
|
|
44
41
|
null
|
|
45
42
|
],
|
|
46
|
-
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA
|
|
43
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAOhBC,sBAAsBA;;;;;cA0BpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCtHFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCqBRC,IAAIA;;;;;;;;;;;;;;;;;;;;cC/BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCGJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCJVC,iBAAiBA",
|
|
47
44
|
"ignoreList": []
|
|
48
45
|
}
|
package/web-tree-sitter.d.ts
CHANGED
|
@@ -48,47 +48,6 @@
|
|
|
48
48
|
/** The memory imported by `web-tree-sitter.wasm`. */
|
|
49
49
|
wasmMemory?: WebAssembly.Memory;
|
|
50
50
|
}
|
|
51
|
-
export class Edit {
|
|
52
|
-
/** The start position of the change. */
|
|
53
|
-
startPosition: Point;
|
|
54
|
-
/** The end position of the change before the edit. */
|
|
55
|
-
oldEndPosition: Point;
|
|
56
|
-
/** The end position of the change after the edit. */
|
|
57
|
-
newEndPosition: Point;
|
|
58
|
-
/** The start index of the change. */
|
|
59
|
-
startIndex: number;
|
|
60
|
-
/** The end index of the change before the edit. */
|
|
61
|
-
oldEndIndex: number;
|
|
62
|
-
/** The end index of the change after the edit. */
|
|
63
|
-
newEndIndex: number;
|
|
64
|
-
constructor({ startIndex, oldEndIndex, newEndIndex, startPosition, oldEndPosition, newEndPosition, }: {
|
|
65
|
-
startIndex: number;
|
|
66
|
-
oldEndIndex: number;
|
|
67
|
-
newEndIndex: number;
|
|
68
|
-
startPosition: Point;
|
|
69
|
-
oldEndPosition: Point;
|
|
70
|
-
newEndPosition: Point;
|
|
71
|
-
});
|
|
72
|
-
/**
|
|
73
|
-
* Edit a point and index to keep it in-sync with source code that has been edited.
|
|
74
|
-
*
|
|
75
|
-
* This function updates a single point's byte offset and row/column position
|
|
76
|
-
* based on an edit operation. This is useful for editing points without
|
|
77
|
-
* requiring a tree or node instance.
|
|
78
|
-
*/
|
|
79
|
-
editPoint(point: Point, index: number): {
|
|
80
|
-
point: Point;
|
|
81
|
-
index: number;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Edit a range to keep it in-sync with source code that has been edited.
|
|
85
|
-
*
|
|
86
|
-
* This function updates a range's start and end positions based on an edit
|
|
87
|
-
* operation. This is useful for editing ranges without requiring a tree
|
|
88
|
-
* or node instance.
|
|
89
|
-
*/
|
|
90
|
-
editRange(range: Range): Range;
|
|
91
|
-
}
|
|
92
51
|
/**
|
|
93
52
|
* Options for parsing
|
|
94
53
|
*
|
|
@@ -203,10 +162,6 @@
|
|
|
203
162
|
*
|
|
204
163
|
* @param callback - The UTF8-encoded text to parse or a callback function.
|
|
205
164
|
*
|
|
206
|
-
* @param oldTree - A previous syntax tree parsed from the same document. If the text of the
|
|
207
|
-
* document has changed since `oldTree` was created, then you must edit `oldTree` to match
|
|
208
|
-
* the new text using {@link Tree#edit}.
|
|
209
|
-
*
|
|
210
165
|
* @param options - Options for parsing the text.
|
|
211
166
|
* This can be used to set the included ranges, or a progress callback.
|
|
212
167
|
*
|
|
@@ -215,7 +170,7 @@
|
|
|
215
170
|
* - The progress callback returned true.
|
|
216
171
|
* - The memory limit was reached or the operation limit was exceeded.
|
|
217
172
|
*/
|
|
218
|
-
parse(callback: string | ParseCallback,
|
|
173
|
+
parse(callback: string | ParseCallback, options?: ParseOptions): Tree | null;
|
|
219
174
|
/**
|
|
220
175
|
* Instruct the parser to start the next parse from the beginning.
|
|
221
176
|
*
|
|
@@ -364,28 +319,8 @@
|
|
|
364
319
|
* forward by the given offset.
|
|
365
320
|
*/
|
|
366
321
|
rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node;
|
|
367
|
-
/**
|
|
368
|
-
* Edit the syntax tree to keep it in sync with source code that has been
|
|
369
|
-
* edited.
|
|
370
|
-
*
|
|
371
|
-
* You must describe the edit both in terms of byte offsets and in terms of
|
|
372
|
-
* row/column coordinates.
|
|
373
|
-
*/
|
|
374
|
-
edit(edit: Edit): void;
|
|
375
322
|
/** Create a new {@link TreeCursor} starting from the root of the tree. */
|
|
376
323
|
walk(): TreeCursor;
|
|
377
|
-
/**
|
|
378
|
-
* Compare this old edited syntax tree to a new syntax tree representing
|
|
379
|
-
* the same document, returning a sequence of ranges whose syntactic
|
|
380
|
-
* structure has changed.
|
|
381
|
-
*
|
|
382
|
-
* For this to work correctly, this syntax tree must have been edited such
|
|
383
|
-
* that its ranges match up to the new tree. Generally, you'll want to
|
|
384
|
-
* call this method right after calling one of the [`Parser::parse`]
|
|
385
|
-
* functions. Call it on the old tree that was passed to parse, and
|
|
386
|
-
* pass the new tree that was returned from `parse`.
|
|
387
|
-
*/
|
|
388
|
-
getChangedRanges(other: Tree): Range[];
|
|
389
324
|
/** Get the included ranges that were used to parse the syntax tree. */
|
|
390
325
|
getIncludedRanges(): Range[];
|
|
391
326
|
}
|
|
@@ -394,14 +329,7 @@
|
|
|
394
329
|
/**
|
|
395
330
|
* The numeric id for this node that is unique.
|
|
396
331
|
*
|
|
397
|
-
* Within a given syntax tree, no two nodes have the same id.
|
|
398
|
-
*
|
|
399
|
-
* * If a new tree is created based on an older tree, and a node from the old tree is reused in
|
|
400
|
-
* the process, then that node will have the same id in both trees.
|
|
401
|
-
*
|
|
402
|
-
* * A node not marked as having changes does not guarantee it was reused.
|
|
403
|
-
*
|
|
404
|
-
* * If a node is marked as having changed in the old tree, it will not be reused.
|
|
332
|
+
* Within a given syntax tree, no two nodes have the same id.
|
|
405
333
|
*/
|
|
406
334
|
id: number;
|
|
407
335
|
/** The byte index where this node starts. */
|
|
@@ -452,8 +380,6 @@
|
|
|
452
380
|
* certain kinds of syntax errors.
|
|
453
381
|
*/
|
|
454
382
|
get isMissing(): boolean;
|
|
455
|
-
/** Check if this node has been edited. */
|
|
456
|
-
get hasChanges(): boolean;
|
|
457
383
|
/**
|
|
458
384
|
* Check if this node represents a syntax error or contains any syntax
|
|
459
385
|
* errors anywhere within it.
|
|
@@ -611,16 +537,6 @@
|
|
|
611
537
|
* and the cursor cannot walk outside this node.
|
|
612
538
|
*/
|
|
613
539
|
walk(): TreeCursor;
|
|
614
|
-
/**
|
|
615
|
-
* Edit this node to keep it in-sync with source code that has been edited.
|
|
616
|
-
*
|
|
617
|
-
* This function is only rarely needed. When you edit a syntax tree with
|
|
618
|
-
* the {@link Tree#edit} method, all of the nodes that you retrieve from
|
|
619
|
-
* the tree afterward will already reflect the edit. You only need to
|
|
620
|
-
* use {@link Node#edit} when you have a specific {@link Node} instance that
|
|
621
|
-
* you want to keep and continue to use after an edit.
|
|
622
|
-
*/
|
|
623
|
-
edit(edit: Edit): void;
|
|
624
540
|
/** Get the S-expression representation of this node. */
|
|
625
541
|
toString(): string;
|
|
626
542
|
}
|
package/web-tree-sitter.d.ts.map
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"ProgressCallback",
|
|
9
9
|
"LogCallback",
|
|
10
10
|
"ParserInitOptions",
|
|
11
|
-
"Edit",
|
|
12
11
|
"ParseOptions",
|
|
13
12
|
"ParseState",
|
|
14
13
|
"LANGUAGE_VERSION",
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
"sources": [
|
|
25
24
|
"src/constants.ts",
|
|
26
25
|
"src/bindings.ts",
|
|
27
|
-
"src/edit.ts",
|
|
28
26
|
"src/parser.ts",
|
|
29
27
|
"src/language.ts",
|
|
30
28
|
"src/tree.ts",
|
|
@@ -40,9 +38,8 @@
|
|
|
40
38
|
null,
|
|
41
39
|
null,
|
|
42
40
|
null,
|
|
43
|
-
null,
|
|
44
41
|
null
|
|
45
42
|
],
|
|
46
|
-
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA
|
|
43
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAOhBC,sBAAsBA;;;;;cA0BpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCtHFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCqBRC,IAAIA;;;;;;;;;;;;;;;;;;;;cC/BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCGJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCJVC,iBAAiBA",
|
|
47
44
|
"ignoreList": []
|
|
48
45
|
}
|
package/web-tree-sitter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var ve=Object.defineProperty;var a=(e,t)=>ve(e,"name",{value:t,configurable:!0});var $=class{static{a(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:n,startPosition:_,oldEndPosition:o,newEndPosition:l}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=n>>>0,this.startPosition=_,this.oldEndPosition=o,this.newEndPosition=l}editPoint(t,r){let n=r,_={...t};if(r>=this.oldEndIndex){n=this.newEndIndex+(r-this.oldEndIndex);let o=t.row;_.row=this.newEndPosition.row+(t.row-this.oldEndPosition.row),_.column=o===this.oldEndPosition.row?this.newEndPosition.column+(t.column-this.oldEndPosition.column):t.column}else r>this.startIndex&&(n=this.newEndIndex,_.row=this.newEndPosition.row,_.column=this.newEndPosition.column);return{point:_,index:n}}editRange(t){let r={startIndex:t.startIndex,startPosition:{...t.startPosition},endIndex:t.endIndex,endPosition:{...t.endPosition}};return t.endIndex>=this.oldEndIndex?t.endIndex!==Number.MAX_SAFE_INTEGER&&(r.endIndex=this.newEndIndex+(t.endIndex-this.oldEndIndex),r.endPosition={row:this.newEndPosition.row+(t.endPosition.row-this.oldEndPosition.row),column:t.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.endPosition.column-this.oldEndPosition.column):t.endPosition.column},r.endIndex<this.newEndIndex&&(r.endIndex=Number.MAX_SAFE_INTEGER,r.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.endIndex>this.startIndex&&(r.endIndex=this.startIndex,r.endPosition={...this.startPosition}),t.startIndex>=this.oldEndIndex?(r.startIndex=this.newEndIndex+(t.startIndex-this.oldEndIndex),r.startPosition={row:this.newEndPosition.row+(t.startPosition.row-this.oldEndPosition.row),column:t.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.startPosition.column-this.oldEndPosition.column):t.startPosition.column},r.startIndex<this.newEndIndex&&(r.startIndex=Number.MAX_SAFE_INTEGER,r.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.startIndex>this.startIndex&&(r.startIndex=this.startIndex,r.startPosition={...this.startPosition}),r}};var P=4,p=5*P,N=2*P,x=2*P+2*N,X={row:0,column:0},w=Symbol("INTERNAL");function M(e){if(e!==w)throw new Error("Illegal constructor")}a(M,"assertInternal");function F(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}a(F,"isPoint");function Q(e){s=e}a(Q,"setModule");var s;function A(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}a(A,"newFinalizer");var ee=A(e=>{s._ts_lookahead_iterator_delete(e)}),C=class{static{a(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,n){M(t),this[0]=r,this.language=n,ee?.register(this,r,this)}get currentTypeId(){return this.positioned?s._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??s.UTF8ToString(s._ts_language_symbol_name(this.language[0],t))}delete(){ee?.unregister(this),s._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return s._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return s._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:a(()=>{this.positioned=!!s._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};var te=A(e=>{s._ts_tree_cursor_delete_wasm(e)}),S=class e{static{a(this,"TreeCursor")}0=0;tree;editVersion=-1;_nodeTypeId=0;_fieldId=0;_startIndex=0;_endIndex=0;_flags=0;constructor(t,r,n){M(t),this[0]=n,this.tree=r,this.readNodeCache(),te?.register(this,n,this)}copy(){let t=s._ts_tree_cursor_copy_wasm(this[0]);return new e(w,this.tree,t)}delete(){te?.unregister(this),s._ts_tree_cursor_delete_wasm(this[0]),this[0]=0}get currentNode(){return s._ts_tree_cursor_current_node_wasm(this[0]),h(this.tree)}get currentFieldId(){return this._fieldId}get currentFieldName(){return this.tree.language.fields[this._fieldId]??null}get currentDepth(){return s._ts_tree_cursor_current_depth(this[0])>>>0}get currentDescendantIndex(){return s._ts_tree_cursor_current_descendant_index(this[0])>>>0}get nodeType(){return this.tree.language.types[this._nodeTypeId]||"ERROR"}get nodeTypeId(){return this._nodeTypeId}get nodeStateId(){return s._ts_tree_cursor_current_node_state_id_wasm(this[0])}get nodeId(){return s._ts_tree_cursor_current_node_id_wasm(this[0])}get nodeIsNamed(){return(this._flags&1)!==0}get nodeIsMissing(){return(this._flags&2)!==0}get nodeText(){this.syncIndices();let{textSource:t}=this.tree;return typeof t=="string"?t.slice(this._startIndex,this._endIndex):D(t,this._startIndex,this._endIndex,this.startPosition)}get startPosition(){return s._ts_tree_cursor_start_position_wasm(this[0]),O(c)}get endPosition(){return s._ts_tree_cursor_end_position_wasm(this[0]),O(c)}get startIndex(){return this.syncIndices(),this._startIndex}get endIndex(){return this.syncIndices(),this._endIndex}gotoFirstChild(){return s._ts_tree_cursor_goto_first_child_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoLastChild(){return s._ts_tree_cursor_goto_last_child_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoParent(){return s._ts_tree_cursor_goto_parent_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoNextSibling(){return s._ts_tree_cursor_goto_next_sibling_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoPreviousSibling(){return s._ts_tree_cursor_goto_previous_sibling_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoDescendant(t){s._ts_tree_cursor_goto_descendant_wasm(this[0],t),this.readNodeCache()}gotoFirstChildForIndex(t){return s._ts_tree_cursor_goto_first_child_for_index_wasm(this[0],t)?(this.readNodeCache(),!0):!1}gotoFirstChildForPosition(t){return s._ts_tree_cursor_goto_first_child_for_position_wasm(this[0],t.row,t.column)?(this.readNodeCache(),!0):!1}reset(t){u(t),this.tree=t.tree,s._ts_tree_cursor_reset_wasm(this[0],t.tree[0]),this.readNodeCache()}resetTo(t){this[0]!==t[0]&&(this.tree=t.tree,s._ts_tree_cursor_reset_to_wasm(this[0],t[0]),this.readNodeCache())}readNodeCache(){let t=c>>>2,r=s.HEAPU32;this._nodeTypeId=r[t],this._fieldId=r[t+1],this._startIndex=r[t+2],this._endIndex=r[t+3],this._flags=r[t+4],this.editVersion=this.tree.editVersion}syncIndices(){this.editVersion!==this.tree.editVersion&&(this._startIndex=s._ts_tree_cursor_start_index_wasm(this[0])>>>0,this._endIndex=s._ts_tree_cursor_end_index_wasm(this[0])>>>0,this.editVersion=this.tree.editVersion)}};function D(e,t,r,n){let _=r-t,o=e(t,n);if(o){for(t+=o.length;t<r;){let l=e(t,n);if(l&&l.length>0)t+=l.length,o+=l;else break}t>r&&(o=o.slice(0,_))}return o??""}a(D,"getCallbackText");var re=A(e=>{s._ts_tree_delete(e)}),L=class e{static{a(this,"Tree")}0=0;textSource;editVersion=0;language;constructor(t,r,n,_){M(t),this[0]=r,this.language=n,this.textSource=_,re?.register(this,r,this)}copy(){let t=s._ts_tree_copy(this[0]);return new e(w,t,this.language,this.textSource)}delete(){re?.unregister(this),s._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return s._ts_tree_root_node_wasm(this[0]),h(this)}rootNodeWithOffset(t,r){let n=c+p;return s.HEAP32[n>>>2]=t,I(n+P,r),s._ts_tree_root_node_with_offset_wasm(this[0]),h(this)}edit(t){ne(t),s._ts_tree_edit_wasm(this[0]),this.editVersion++}walk(){s._ts_tree_root_node_wasm(this[0]);let t=s._ts_tree_cursor_new_wasm(this[0]);return new S(w,this,t)}getChangedRanges(t){if(!(t instanceof e))throw new TypeError("Argument must be a Tree");return s._ts_tree_get_changed_ranges_wasm(this[0],t[0]),U()}getIncludedRanges(){return s._ts_tree_included_ranges_wasm(this[0]),U()}};var H=class{static{a(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:n,startIndex:_,startPosition:o,other:l}){M(t),this[0]=l,this.id=r,this.tree=n,this.startIndex=_,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return u(this),s._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return u(this),s._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return u(this),s._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return u(this),s._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return u(this),s._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return u(this),s._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return u(this),s._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return u(this),s._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return u(this),s._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return u(this),s._ts_node_end_point_wasm(this.tree[0]),O(c)}get text(){let{textSource:t}=this.tree;return typeof t=="string"?t.slice(this.startIndex,this.endIndex):D(t,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return u(this),s._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return u(this),s._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return u(this),s._ts_node_child_wasm(this.tree[0],t),h(this.tree)}namedChild(t){return u(this),s._ts_node_named_child_wasm(this.tree[0],t),h(this.tree)}childForFieldId(t){return u(this),s._ts_node_child_by_field_id_wasm(this.tree[0],t),h(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){u(this);let r=s._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?s.AsciiToString(r):null}fieldNameForNamedChild(t){u(this);let r=s._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?s.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){return u(this),s._ts_node_children_by_field_id_wasm(this.tree[0],t),W(this.tree,!0)}firstChildForIndex(t){u(this);let r=c+p;return s.HEAP32[r>>>2]=t,s._ts_node_first_child_for_byte_wasm(this.tree[0]),h(this.tree)}firstNamedChildForIndex(t){u(this);let r=c+p;return s.HEAP32[r>>>2]=t,s._ts_node_first_named_child_for_byte_wasm(this.tree[0]),h(this.tree)}get childCount(){return u(this),s._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return u(this),s._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){return this._children||(u(this),s._ts_node_children_wasm(this.tree[0]),this._children=W(this.tree)),this._children}get namedChildren(){return this._namedChildren||(u(this),s._ts_node_named_children_wasm(this.tree[0]),this._namedChildren=W(this.tree)),this._namedChildren}descendantsOfType(t,r=X,n=X){Array.isArray(t)||(t=[t]);let _=[],o=this.tree.language.types;for(let g=0,T=o.length;g<T;g++)t.includes(o[g])&&_.push(g);t.includes("ERROR")&&_.push(65535);let l=s._malloc(P*_.length),d=s.HEAPU32,m=l>>>2;for(let g=0,T=_.length;g<T;g++)d[m+g]=_[g];u(this);let b=c+p;I(b,r),I(b+N,n),s._ts_node_descendants_of_type_wasm(this.tree[0],l,_.length);let y=W(this.tree,!0);return s._free(l),y}get nextSibling(){return u(this),s._ts_node_next_sibling_wasm(this.tree[0]),h(this.tree)}get previousSibling(){return u(this),s._ts_node_prev_sibling_wasm(this.tree[0]),h(this.tree)}get nextNamedSibling(){return u(this),s._ts_node_next_named_sibling_wasm(this.tree[0]),h(this.tree)}get previousNamedSibling(){return u(this),s._ts_node_prev_named_sibling_wasm(this.tree[0]),h(this.tree)}get descendantCount(){return u(this),s._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return u(this),s._ts_node_parent_wasm(this.tree[0]),h(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(u(this),u(t,1),s._ts_node_child_with_descendant_wasm(this.tree[0]),h(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let n=c+p>>>2,_=s.HEAP32;return _[n]=t,_[n+1]=r,s._ts_node_descendant_for_index_wasm(this.tree[0]),h(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let n=c+p>>>2,_=s.HEAP32;return _[n]=t,_[n+1]=r,s._ts_node_named_descendant_for_index_wasm(this.tree[0]),h(this.tree)}descendantForPosition(t,r=t){if(!F(t)||!F(r))throw new Error("Arguments must be {row, column} objects");u(this);let n=c+p;return I(n,t),I(n+N,r),s._ts_node_descendant_for_position_wasm(this.tree[0]),h(this.tree)}namedDescendantForPosition(t,r=t){if(!F(t)||!F(r))throw new Error("Arguments must be {row, column} objects");u(this);let n=c+p;return I(n,t),I(n+N,r),s._ts_node_named_descendant_for_position_wasm(this.tree[0]),h(this.tree)}walk(){u(this);let t=s._ts_tree_cursor_new_wasm(this.tree[0]);return new S(w,this.tree,t)}edit(t){let{point:r,index:n}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=n}toString(){u(this);let t=s._ts_node_to_string_wasm(this.tree[0]),r=s.AsciiToString(t);return s._ts_free_wasm(t),r}};function u(e,t=0){let r=c+t*p>>>2,n=s.HEAP32;n[r]=e.id,n[r+1]=e.startIndex,n[r+2]=e.startPosition.row,n[r+3]=e.startPosition.column,n[r+4]=e[0]}a(u,"marshalNode");function h(e,t=c){let r=t>>>2,n=s.HEAP32,_=n[r];if(_===0)return null;let o=s.HEAPU32;return new H(w,{id:_,tree:e,startIndex:o[r+1],startPosition:{row:o[r+2],column:o[r+3]},other:n[r+4]})}a(h,"unmarshalNode");function I(e,t){let r=e>>>2,n=s.HEAP32;n[r]=t.row,n[r+1]=t.column}a(I,"marshalPoint");function O(e){let t=e>>>2,r=s.HEAPU32;return{row:r[t],column:r[t+1]}}a(O,"unmarshalPoint");function se(e,t){let r=e>>>2,n=s.HEAP32;n[r]=t.startPosition.row,n[r+1]=t.startPosition.column,n[r+2]=t.endPosition.row,n[r+3]=t.endPosition.column,n[r+4]=t.startIndex,n[r+5]=t.endIndex}a(se,"marshalRange");function Me(e){let t=e>>>2,r=s.HEAPU32;return{startPosition:{row:r[t],column:r[t+1]},endPosition:{row:r[t+2],column:r[t+3]},startIndex:r[t+4],endIndex:r[t+5]}}a(Me,"unmarshalRange");function ne(e,t=c){let r=t>>>2,n=s.HEAP32;n[r]=e.startPosition.row,n[r+1]=e.startPosition.column,n[r+2]=e.oldEndPosition.row,n[r+3]=e.oldEndPosition.column,n[r+4]=e.newEndPosition.row,n[r+5]=e.newEndPosition.column,n[r+6]=e.startIndex,n[r+7]=e.oldEndIndex,n[r+8]=e.newEndIndex}a(ne,"marshalEdit");function _e(e){let t=e>>>2,r=s.HEAP32;return{major_version:r[t],minor_version:r[t+1],patch_version:r[t+2]}}a(_e,"unmarshalLanguageMetadata");function Z(){let e=c>>>2,t=s.HEAPU32[e],r=s.HEAPU32[e+1],n=new Array(t);if(t>0){let _=r>>>1,o=s.HEAPU16;for(let l=0;l<t;l++)n[l]=o[_+l]}return n}a(Z,"unmarshalSymbols");function U(e=!0){return ae(x,Me,e)}a(U,"unmarshalRanges");function W(e,t=!1){return ae(p,r=>h(e,r),t)}a(W,"unmarshalNodeArray");function ae(e,t,r){let n=c>>>2,_=s.HEAPU32[n],o=s.HEAP32[n+1],l=new Array(_);for(let d=0,m=o;d<_;d++,m+=e)l[d]=t(m);return o&&(r?s._ts_free_wasm(o):s._free(o)),l}a(ae,"unmarshalArray");var Pe=/^tree_sitter_\w+$/,R=class{static{a(this,"Language")}0=0;types;fields;constructor(t,r){M(t),this[0]=r,this.types=new Array(s._ts_language_symbol_count(this[0]));for(let n=0,_=this.types.length;n<_;n++)s._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=s.UTF8ToString(s._ts_language_symbol_name(this[0],n)));this.fields=new Array(s._ts_language_field_count(this[0])+1);for(let n=0,_=this.fields.length;n<_;n++){let o=s._ts_language_field_name_for_id(this[0],n);o!==0?this.fields[n]=s.UTF8ToString(o):this.fields[n]=null}}get name(){let t=s._ts_language_name(this[0]);return t===0?null:s.UTF8ToString(t)}get abiVersion(){return s._ts_language_abi_version(this[0])}get metadata(){return s._ts_language_metadata_wasm(this[0]),s.HEAP32[c>>>2]===0?null:_e(c+P)}get fieldCount(){return this.fields.length-1}get stateCount(){return s._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]??null}idForNodeType(t,r){let n=s.lengthBytesUTF8(t),_=s._malloc(n+1);s.stringToUTF8(t,_,n+1);let o=s._ts_language_symbol_for_name(this[0],_,n,r?1:0);return s._free(_),o||null}get nodeTypeCount(){return s._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=s._ts_language_symbol_name(this[0],t);return r?s.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!s._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!s._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){return s._ts_language_supertypes_wasm(this[0]),Z()}subtypes(t){return s._ts_language_subtypes_wasm(this[0],t),Z()}nextState(t,r){return s._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=s._ts_lookahead_iterator_new(this[0],t);return r?new C(w,r,this):null}static async load(t){let r;if(t instanceof Uint8Array||t instanceof WebAssembly.Module)r=t;else if(globalThis.process?.versions.node)r=await(await import("fs/promises")).readFile(t);else{let _=await fetch(t);if(!_.ok){let l=await _.text();throw new Error(`Language.load failed with status ${_.status}.
|
|
1
|
+
var we=Object.defineProperty;var n=(e,t)=>we(e,"name",{value:t,configurable:!0});var T=4,w=5*T,E=2*T,F=2*T+2*E,V={row:0,column:0},p=Symbol("INTERNAL");function M(e){if(e!==p)throw new Error("Illegal constructor")}n(M,"assertInternal");function C(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}n(C,"isPoint");function J(e){_=e}n(J,"setModule");var _;function P(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}n(P,"newFinalizer");var Q=P(e=>{_._ts_lookahead_iterator_delete(e)}),O=class{static{n(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,s){M(t),this[0]=r,this.language=s,Q?.register(this,r,this)}get currentTypeId(){return this.positioned?_._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??_.UTF8ToString(_._ts_language_symbol_name(this.language[0],t))}delete(){Q?.unregister(this),_._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return _._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return _._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:n(()=>{this.positioned=!!_._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};var ee=P(e=>{_._ts_tree_cursor_delete_wasm(e)}),R=class e{static{n(this,"TreeCursor")}0=0;tree;_nodeTypeId=0;_fieldId=0;_startIndex=0;_endIndex=0;_flags=0;constructor(t,r,s){M(t),this[0]=s,this.tree=r,this.readNodeCache(),ee?.register(this,s,this)}copy(){let t=_._ts_tree_cursor_copy_wasm(this[0]);return new e(p,this.tree,t)}delete(){ee?.unregister(this),_._ts_tree_cursor_delete_wasm(this[0]),this[0]=0}get currentNode(){return _._ts_tree_cursor_current_node_wasm(this[0]),f(this.tree)}get currentFieldId(){return this._fieldId}get currentFieldName(){return this.tree.language.fields[this._fieldId]??null}get currentDepth(){return _._ts_tree_cursor_current_depth(this[0])>>>0}get currentDescendantIndex(){return _._ts_tree_cursor_current_descendant_index(this[0])>>>0}get nodeType(){return this.tree.language.types[this._nodeTypeId]||"ERROR"}get nodeTypeId(){return this._nodeTypeId}get nodeStateId(){return _._ts_tree_cursor_current_node_state_id_wasm(this[0])}get nodeId(){return _._ts_tree_cursor_current_node_id_wasm(this[0])}get nodeIsNamed(){return(this._flags&1)!==0}get nodeIsMissing(){return(this._flags&2)!==0}get nodeText(){let{textSource:t}=this.tree;return typeof t=="string"?t.slice(this._startIndex,this._endIndex):B(t,this._startIndex,this._endIndex,this.startPosition)}get startPosition(){return _._ts_tree_cursor_start_position_wasm(this[0]),L(c)}get endPosition(){return _._ts_tree_cursor_end_position_wasm(this[0]),L(c)}get startIndex(){return this._startIndex}get endIndex(){return this._endIndex}gotoFirstChild(){return _._ts_tree_cursor_goto_first_child_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoLastChild(){return _._ts_tree_cursor_goto_last_child_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoParent(){return _._ts_tree_cursor_goto_parent_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoNextSibling(){return _._ts_tree_cursor_goto_next_sibling_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoPreviousSibling(){return _._ts_tree_cursor_goto_previous_sibling_wasm(this[0])?(this.readNodeCache(),!0):!1}gotoDescendant(t){_._ts_tree_cursor_goto_descendant_wasm(this[0],t),this.readNodeCache()}gotoFirstChildForIndex(t){return _._ts_tree_cursor_goto_first_child_for_index_wasm(this[0],t)?(this.readNodeCache(),!0):!1}gotoFirstChildForPosition(t){return _._ts_tree_cursor_goto_first_child_for_position_wasm(this[0],t.row,t.column)?(this.readNodeCache(),!0):!1}reset(t){u(t),this.tree=t.tree,_._ts_tree_cursor_reset_wasm(this[0],t.tree[0]),this.readNodeCache()}resetTo(t){this[0]!==t[0]&&(this.tree=t.tree,_._ts_tree_cursor_reset_to_wasm(this[0],t[0]),this.readNodeCache())}readNodeCache(){let t=c>>>2,r=_.HEAPU32;this._nodeTypeId=r[t],this._fieldId=r[t+1],this._startIndex=r[t+2],this._endIndex=r[t+3],this._flags=r[t+4]}};function B(e,t,r,s){let a=r-t,o=e(t,s);if(o){for(t+=o.length;t<r;){let l=e(t,s);if(l&&l.length>0)t+=l.length,o+=l;else break}t>r&&(o=o.slice(0,a))}return o??""}n(B,"getCallbackText");var te=P(e=>{_._ts_tree_delete(e)}),U=class e{static{n(this,"Tree")}0=0;textSource;language;constructor(t,r,s,a){M(t),this[0]=r,this.language=s,this.textSource=a,te?.register(this,r,this)}copy(){let t=_._ts_tree_copy(this[0]);return new e(p,t,this.language,this.textSource)}delete(){te?.unregister(this),_._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return _._ts_tree_root_node_wasm(this[0]),f(this)}rootNodeWithOffset(t,r){let s=c+w;return _.HEAP32[s>>>2]=t,A(s+T,r),_._ts_tree_root_node_with_offset_wasm(this[0]),f(this)}walk(){_._ts_tree_root_node_wasm(this[0]);let t=_._ts_tree_cursor_new_wasm(this[0]);return new R(p,this,t)}getIncludedRanges(){return _._ts_tree_included_ranges_wasm(this[0]),D()}};var W=class{static{n(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:s,startIndex:a,startPosition:o,other:l}){M(t),this[0]=l,this.id=r,this.tree=s,this.startIndex=a,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return u(this),_._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return u(this),_._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return u(this),_._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return u(this),_._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return u(this),_._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return u(this),_._ts_node_is_missing_wasm(this.tree[0])===1}get hasError(){return u(this),_._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return u(this),_._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return u(this),_._ts_node_end_point_wasm(this.tree[0]),L(c)}get text(){let{textSource:t}=this.tree;return typeof t=="string"?t.slice(this.startIndex,this.endIndex):B(t,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return u(this),_._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return u(this),_._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return u(this),_._ts_node_child_wasm(this.tree[0],t),f(this.tree)}namedChild(t){return u(this),_._ts_node_named_child_wasm(this.tree[0],t),f(this.tree)}childForFieldId(t){return u(this),_._ts_node_child_by_field_id_wasm(this.tree[0],t),f(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){u(this);let r=_._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?_.AsciiToString(r):null}fieldNameForNamedChild(t){u(this);let r=_._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?_.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){return u(this),_._ts_node_children_by_field_id_wasm(this.tree[0],t),x(this.tree,!0)}firstChildForIndex(t){u(this);let r=c+w;return _.HEAP32[r>>>2]=t,_._ts_node_first_child_for_byte_wasm(this.tree[0]),f(this.tree)}firstNamedChildForIndex(t){u(this);let r=c+w;return _.HEAP32[r>>>2]=t,_._ts_node_first_named_child_for_byte_wasm(this.tree[0]),f(this.tree)}get childCount(){return u(this),_._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return u(this),_._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){return this._children||(u(this),_._ts_node_children_wasm(this.tree[0]),this._children=x(this.tree)),this._children}get namedChildren(){return this._namedChildren||(u(this),_._ts_node_named_children_wasm(this.tree[0]),this._namedChildren=x(this.tree)),this._namedChildren}descendantsOfType(t,r=V,s=V){Array.isArray(t)||(t=[t]);let a=[],o=this.tree.language.types;for(let g=0,I=o.length;g<I;g++)t.includes(o[g])&&a.push(g);t.includes("ERROR")&&a.push(65535);let l=_._malloc(T*a.length),d=_.HEAPU32,m=l>>>2;for(let g=0,I=a.length;g<I;g++)d[m+g]=a[g];u(this);let b=c+w;A(b,r),A(b+E,s),_._ts_node_descendants_of_type_wasm(this.tree[0],l,a.length);let y=x(this.tree,!0);return _._free(l),y}get nextSibling(){return u(this),_._ts_node_next_sibling_wasm(this.tree[0]),f(this.tree)}get previousSibling(){return u(this),_._ts_node_prev_sibling_wasm(this.tree[0]),f(this.tree)}get nextNamedSibling(){return u(this),_._ts_node_next_named_sibling_wasm(this.tree[0]),f(this.tree)}get previousNamedSibling(){return u(this),_._ts_node_prev_named_sibling_wasm(this.tree[0]),f(this.tree)}get descendantCount(){return u(this),_._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return u(this),_._ts_node_parent_wasm(this.tree[0]),f(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(u(this),u(t,1),_._ts_node_child_with_descendant_wasm(this.tree[0]),f(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let s=c+w>>>2,a=_.HEAP32;return a[s]=t,a[s+1]=r,_._ts_node_descendant_for_index_wasm(this.tree[0]),f(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let s=c+w>>>2,a=_.HEAP32;return a[s]=t,a[s+1]=r,_._ts_node_named_descendant_for_index_wasm(this.tree[0]),f(this.tree)}descendantForPosition(t,r=t){if(!C(t)||!C(r))throw new Error("Arguments must be {row, column} objects");u(this);let s=c+w;return A(s,t),A(s+E,r),_._ts_node_descendant_for_position_wasm(this.tree[0]),f(this.tree)}namedDescendantForPosition(t,r=t){if(!C(t)||!C(r))throw new Error("Arguments must be {row, column} objects");u(this);let s=c+w;return A(s,t),A(s+E,r),_._ts_node_named_descendant_for_position_wasm(this.tree[0]),f(this.tree)}walk(){u(this);let t=_._ts_tree_cursor_new_wasm(this.tree[0]);return new R(p,this.tree,t)}toString(){u(this);let t=_._ts_node_to_string_wasm(this.tree[0]),r=_.AsciiToString(t);return _._ts_free_wasm(t),r}};function u(e,t=0){let r=c+t*w>>>2,s=_.HEAP32;s[r]=e.id,s[r+1]=e.startIndex,s[r+2]=e.startPosition.row,s[r+3]=e.startPosition.column,s[r+4]=e[0]}n(u,"marshalNode");function f(e,t=c){let r=t>>>2,s=_.HEAP32,a=s[r];if(a===0)return null;let o=_.HEAPU32;return new W(p,{id:a,tree:e,startIndex:o[r+1],startPosition:{row:o[r+2],column:o[r+3]},other:s[r+4]})}n(f,"unmarshalNode");function A(e,t){let r=e>>>2,s=_.HEAP32;s[r]=t.row,s[r+1]=t.column}n(A,"marshalPoint");function L(e){let t=e>>>2,r=_.HEAPU32;return{row:r[t],column:r[t+1]}}n(L,"unmarshalPoint");function re(e,t){let r=e>>>2,s=_.HEAP32;s[r]=t.startPosition.row,s[r+1]=t.startPosition.column,s[r+2]=t.endPosition.row,s[r+3]=t.endPosition.column,s[r+4]=t.startIndex,s[r+5]=t.endIndex}n(re,"marshalRange");function ye(e){let t=e>>>2,r=_.HEAPU32;return{startPosition:{row:r[t],column:r[t+1]},endPosition:{row:r[t+2],column:r[t+3]},startIndex:r[t+4],endIndex:r[t+5]}}n(ye,"unmarshalRange");function _e(e){let t=e>>>2,r=_.HEAP32;return{major_version:r[t],minor_version:r[t+1],patch_version:r[t+2]}}n(_e,"unmarshalLanguageMetadata");function Z(){let e=c>>>2,t=_.HEAPU32[e],r=_.HEAPU32[e+1],s=new Array(t);if(t>0){let a=r>>>1,o=_.HEAPU16;for(let l=0;l<t;l++)s[l]=o[a+l]}return s}n(Z,"unmarshalSymbols");function D(e=!0){return se(F,ye,e)}n(D,"unmarshalRanges");function x(e,t=!1){return se(w,r=>f(e,r),t)}n(x,"unmarshalNodeArray");function se(e,t,r){let s=c>>>2,a=_.HEAPU32[s],o=_.HEAP32[s+1],l=new Array(a);for(let d=0,m=o;d<a;d++,m+=e)l[d]=t(m);return o&&(r?_._ts_free_wasm(o):_._free(o)),l}n(se,"unmarshalArray");var ve=/^tree_sitter_\w+$/,k=class{static{n(this,"Language")}0=0;types;fields;constructor(t,r){M(t),this[0]=r,this.types=new Array(_._ts_language_symbol_count(this[0]));for(let s=0,a=this.types.length;s<a;s++)_._ts_language_symbol_type(this[0],s)<2&&(this.types[s]=_.UTF8ToString(_._ts_language_symbol_name(this[0],s)));this.fields=new Array(_._ts_language_field_count(this[0])+1);for(let s=0,a=this.fields.length;s<a;s++){let o=_._ts_language_field_name_for_id(this[0],s);o!==0?this.fields[s]=_.UTF8ToString(o):this.fields[s]=null}}get name(){let t=_._ts_language_name(this[0]);return t===0?null:_.UTF8ToString(t)}get abiVersion(){return _._ts_language_abi_version(this[0])}get metadata(){return _._ts_language_metadata_wasm(this[0]),_.HEAP32[c>>>2]===0?null:_e(c+T)}get fieldCount(){return this.fields.length-1}get stateCount(){return _._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]??null}idForNodeType(t,r){let s=_.lengthBytesUTF8(t),a=_._malloc(s+1);_.stringToUTF8(t,a,s+1);let o=_._ts_language_symbol_for_name(this[0],a,s,r?1:0);return _._free(a),o||null}get nodeTypeCount(){return _._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=_._ts_language_symbol_name(this[0],t);return r?_.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!_._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!_._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){return _._ts_language_supertypes_wasm(this[0]),Z()}subtypes(t){return _._ts_language_subtypes_wasm(this[0],t),Z()}nextState(t,r){return _._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=_._ts_lookahead_iterator_new(this[0],t);return r?new O(p,r,this):null}static async load(t){let r;if(t instanceof Uint8Array||t instanceof WebAssembly.Module)r=t;else if(globalThis.process?.versions.node)r=await(await import("fs/promises")).readFile(t);else{let a=await fetch(t);if(!a.ok){let l=await a.text();throw new Error(`Language.load failed with status ${a.status}.
|
|
2
2
|
|
|
3
|
-
${l}`)}let o=
|
|
4
|
-
${JSON.stringify(r,null,2)}`),new Error(`Language.${t?"loadSync":"load"} failed: no language function found in Wasm file`);let _=e[n]();return new R(w,_)}a(oe,"loadFromWasmExports");async function Ie(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await import("module");var require=e(import.meta.url)}Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null,Module.treeSitterSetMemoryLimit=function(e){return e?wasmMemory.buffer.byteLength>e||Module.treeSitterOriginalMemoryGrow?!1:(Module.treeSitterOriginalMemoryGrow=wasmMemory.grow,wasmMemory.grow=function(t){if(wasmMemory.buffer.byteLength+t*65536>e)throw new RangeError("Parse memory limit exceeded");return Module.treeSitterOriginalMemoryGrow.call(wasmMemory,t)},!0):(Module.treeSitterOriginalMemoryGrow&&(wasmMemory.grow=Module.treeSitterOriginalMemoryGrow,Module.treeSitterOriginalMemoryGrow=null),!0)};var arguments_=[],thisProgram="./this.program",quit_=a((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=a(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=a(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},"readAsync"),process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=a((e,t)=>{throw process.exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=a(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=a(async e=>{if(isFileURI(e))return new Promise((r,n)=>{var _=new XMLHttpRequest;_.open("GET",e,!0),_.responseType="arraybuffer",_.onload=()=>{if(_.status==200||_.status==0&&_.response){r(_.response);return}n(_.status)},_.onerror=n,_.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=a(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;HEAP8=new Int8Array(e),HEAP16=new Int16Array(e),HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),HEAPF32=new Float32Array(e),HEAPF64=new Float64Array(e),HEAP64=new BigInt64Array(e),HEAPU64=new BigUint64Array(e)}a(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||4194304;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}a(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}a(initRuntime,"initRuntime");function preMain(){}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}a(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}a(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}a(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}a(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),n=await WebAssembly.instantiate(r,t);return n}catch(_){err(`failed to asynchronously prepare wasm: ${_}`),abort(_)}}a(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var n=fetch(t,{credentials:"same-origin"}),_=await WebAssembly.instantiateStreaming(n,r);return _}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");async function createWasm(){function e(o,l){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var d=getDylinkMetadata(l);d.neededDynlibs&&(dynamicLibraries=d.neededDynlibs.concat(dynamicLibraries));let m={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,m),updateGOT(m,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}a(e,"receiveInstance");function t(o){return e(o.instance,o.module)}a(t,"receiveInstantiationResult");var r=getWasmImports();if(Module.instantiateWasm)return new Promise((o,l)=>{Module.instantiateWasm(r,(d,m)=>{o(e(d,m))})});wasmBinaryFile??=findWasmBinary();var n=await instantiateAsync(wasmBinary,wasmBinaryFile,r),_=t(n);return _}a(createWasm,"createWasm");class ExitStatus{static{a(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=a(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=a(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=a(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=a((e,t,r,n)=>{var _=t+r;if(n)return _;for(;e[t]&&!(t>=_);)++t;return t},"findStringEnd"),UTF8ArrayToString=a((e,t=0,r,n)=>{var _=findStringEnd(e,t,r,n);if(_-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,_));for(var o="";t<_;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var d=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|d);continue}var m=e[t++]&63;if((l&240)==224?l=(l&15)<<12|d<<6|m:l=(l&7)<<18|d<<12|m<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var b=l-65536;o+=String.fromCharCode(55296|b>>10,56320|b&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=a(e=>{var t=0,r=0;function n(){return e[t++]}a(n,"getU8");function _(){for(var v=0,E=1;;){var J=e[t++];if(v+=(J&127)*E,E*=128,!(J&128))break}return v}a(_,"getLEB");function o(){var v=_();return t+=v,UTF8ArrayToString(e,t-v,v)}a(o,"getString");function l(){for(var v=_(),E=[];v--;)E.push(o());return E}a(l,"getStringList");function d(v,E){if(v)throw new Error(E)}if(a(d,"failIf"),e instanceof WebAssembly.Module){var m=WebAssembly.Module.customSections(e,"dylink.0");d(m.length===0,"need dylink section"),e=new Uint8Array(m[0]),r=e.length}else{var b=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),y=b[0]==1836278016;d(!y,"need to see wasm magic number"),d(e[8]!==0,"need the dylink section to be first"),t=9;var g=_();r=t+g;var T=o();d(T!=="dylink.0")}for(var f={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},me=1,ce=2,ge=3,he=4,fe=5,we=256,be=3,pe=1;t<r;){var k=n(),ye=_();if(k===me)f.memorySize=_(),f.memoryAlign=_(),f.tableSize=_(),f.tableAlign=_();else if(k===ce)f.neededDynlibs=l();else if(k===ge)for(var j=_();j--;){var z=o(),V=_();V&we&&f.tlsExports.add(z)}else if(k===he)for(var j=_();j--;){var xe=o(),z=o(),V=_();(V&be)==pe&&f.weakImports.add(z)}else k===fe?f.runtimePaths=l():t+=ye}return f},"getDylinkMetadata"),newDSO=a((e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82656,alignMemory=a((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=a(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},"getMemory"),isInternalSym=a(e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=a(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=a(e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),"generateTypePack"),convertJsFunctionToWasm=a((e,t)=>{var r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),n=new WebAssembly.Module(r),_=new WebAssembly.Instance(n,{e:{f:e}}),o=_.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:50,element:"anyfunc"}),getWasmTableEntry=a(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=a((e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},"updateTableMap"),functionsInTableMap,getFunctionAddress=a(e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=a((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=a((e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var _=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,_)}return functionsInTableMap.set(e,n),n},"addFunction"),updateGOT=a((e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((e,t,r)=>{var n={};for(var _ in e){var o=e[_];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),n[_]=o}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=a((e,t,r=[],n=!1)=>{var _=getWasmTableEntry(t),o=_(...r);function l(d){return d}return a(l,"convert"),o},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=a(e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(_){if(stackRestore(n),_!==_+0)throw _;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=a((e,t=!1)=>{var r;return isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=a(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=a((e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize),metadata.tableSize&&wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var r=wasmImports[t];return r}if(!(t in e)){var n;e[t]=(..._)=>(n||=resolveSymbol(t),n(..._))}return e[t]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=await WebAssembly.instantiate(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((e,t)=>{for(var[r,n]of Object.entries(e)){let _=a(l=>{isSymbolDefined(l)||(wasmImports[l]=n)},"setImport");_(r);let o="__main_argc_argv";r=="main"&&_(o),r==o&&_("main")}},"mergeLibSymbols"),asyncLoad=a(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var _=LDSO.loadedLibsByName[e];if(_)return t.global?_.global||(_.global=!0,mergeLibSymbols(_.exports,e)):r&&Object.assign(r,_.exports),t.nodelete&&_.refcount!==1/0&&(_.refcount=1/0),_.refcount++,n&&(LDSO.loadedLibsByHandle[n]=_),t.loadAsync?Promise.resolve(!0):!0;_=newDSO(e,n,"loading"),_.refcount=t.nodelete?1/0:1,_.global=t.global;function o(){if(n){var m=HEAPU32[n+28>>2],b=HEAPU32[n+32>>2];if(m&&b){var y=HEAP8.slice(m,m+b);return t.loadAsync?Promise.resolve(y):y}}var g=locateFile(e);if(t.loadAsync)return asyncLoad(g);if(!readBinary)throw new Error(`${g}: file not found, and synchronous loading of external files is not available`);return readBinary(g)}a(o,"loadLibData");function l(){return t.loadAsync?o().then(m=>loadWebAssemblyModule(m,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}a(l,"getExports");function d(m){_.global?mergeLibSymbols(m,e):r&&Object.assign(r,m),_.exports=m}return a(d,"moduleLoaded"),t.loadAsync?l().then(m=>(d(m),!0)):(d(l()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error(`bad export type for '${e}': ${typeof r}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=a(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=a(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=a(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0,___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82656,___stack_low=17120,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82656),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=a(()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},"__emscripten_runtime_keepalive_clear");__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=a(()=>{throw 1/0},"__emscripten_throw_longjmp");__emscripten_throw_longjmp.sig="v";var timers={},handleException=a(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),_exit=exitJS;_exit.sig="vi";var maybeExit=a(()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},"maybeExit"),callUserCallback=a(e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},"callUserCallback"),_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var __setitimer_js=a((e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0},"__setitimer_js");__setitimer_js.sig="iid";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var _=t*(1+0/n);_=Math.min(_,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,_),65536)),l=growMemory(o);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,r,n,_,o){let l=Module.currentParseCallback,d=typeof l=="string",m=d?l:l(r,{row:n,column:_}),b=d?r:0,y=typeof m=="string"?m.length-b:0;if(y<=0){HEAP32[o>>>2]=0;return}let g=y<t?y:t;if(g<y&&g>1){let f=m.charCodeAt(b+g-1);f>=55296&&f<=56319&&g--}let T=e>>>1;for(let f=0;f<g;f++)HEAPU16[T+f]=m.charCodeAt(b+f);HEAP32[o>>>2]=g}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}a(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");var lengthBytesUTF8=a(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=a((e,t,r,n)=>{if(!(n>0))return 0;for(var _=r,o=r+n-1,l=0;l<e.length;++l){var d=e.codePointAt(l);if(d<=127){if(r>=o)break;t[r++]=d}else if(d<=2047){if(r+1>=o)break;t[r++]=192|d>>6,t[r++]=128|d&63}else if(d<=65535){if(r+2>=o)break;t[r++]=224|d>>12,t[r++]=128|d>>6&63,t[r++]=128|d&63}else{if(r+3>=o)break;t[r++]=240|d>>18,t[r++]=128|d>>12&63,t[r++]=128|d>>6&63,t[r++]=128|d&63,l++}}return t[r]=0,r-_},"stringToUTF8Array"),stringToUTF8=a((e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),"stringToUTF8"),stackAlloc=a(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=a(e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},"stringToUTF8OnStack"),AsciiToString=a(e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},"AsciiToString");if(initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.loadWebAssemblyModule=loadWebAssemblyModule;var ASM_CONSTS={},_free,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_memcmp,_ts_tree_cursor_current_descendant_index,_ts_tree_cursor_current_depth,_ts_tree_copy,_ts_tree_delete,_malloc,_calloc,_realloc,_ts_init,_ts_free_wasm,_ts_scanner_malloc_wasm,_ts_scanner_calloc_wasm,_ts_scanner_realloc_wasm,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_parse_limited_wasm,_ts_parser_last_parse_operations_wasm,_ts_parser_abort_limited_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm,_ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_end_point_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_changes_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_memcpy,_memmove,_memset,_iswalnum,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswspace,_iswupper,_iswxdigit,_memchr,__emscripten_timeout,_strcmp,_strlen,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._free=_free=e.free,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._memcmp=_memcmp=e.memcmp,Module._ts_tree_cursor_current_descendant_index=_ts_tree_cursor_current_descendant_index=e.ts_tree_cursor_current_descendant_index,Module._ts_tree_cursor_current_depth=_ts_tree_cursor_current_depth=e.ts_tree_cursor_current_depth,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._ts_init=_ts_init=e.ts_init,Module._ts_free_wasm=_ts_free_wasm=e.ts_free_wasm,Module._ts_scanner_malloc_wasm=_ts_scanner_malloc_wasm=e.ts_scanner_malloc_wasm,Module._ts_scanner_calloc_wasm=_ts_scanner_calloc_wasm=e.ts_scanner_calloc_wasm,Module._ts_scanner_realloc_wasm=_ts_scanner_realloc_wasm=e.ts_scanner_realloc_wasm,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_parse_limited_wasm=_ts_parser_parse_limited_wasm=e.ts_parser_parse_limited_wasm,Module._ts_parser_last_parse_operations_wasm=_ts_parser_last_parse_operations_wasm=e.ts_parser_last_parse_operations_wasm,Module._ts_parser_abort_limited_wasm=_ts_parser_abort_limited_wasm=e.ts_parser_abort_limited_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=e.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=e.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=e.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=e.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=e.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=e.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=e.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._memset=_memset=e.memset,Module._iswalnum=_iswalnum=e.iswalnum,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswspace=_iswspace=e.iswspace,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,__emscripten_timeout=e._emscripten_timeout,Module._strcmp=_strcmp=e.strcmp,Module._strlen=_strlen=e.strlen,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}a(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_setitimer_js:__setitimer_js,emscripten_resize_heap:_emscripten_resize_heap,invoke_i,invoke_iii,invoke_iiiij,invoke_vi,invoke_vii,invoke_viii,memory:wasmMemory,proc_exit:_proc_exit,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback};function invoke_iii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(_){if(stackRestore(n),_!==_+0)throw _;_setThrew(1,0)}}a(invoke_iii,"invoke_iii");function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}a(invoke_vi,"invoke_vi");function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}a(invoke_i,"invoke_i");function invoke_viii(e,t,r,n){var _=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(o){if(stackRestore(_),o!==o+0)throw o;_setThrew(1,0)}}a(invoke_viii,"invoke_viii");function invoke_iiiij(e,t,r,n,_){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,_)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}a(invoke_iiiij,"invoke_iiiij");function invoke_vii(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(_){if(stackRestore(n),_!==_+0)throw _;_setThrew(1,0)}}a(invoke_vii,"invoke_vii");function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),_=n;e.forEach(l=>{HEAPU32[_>>2]=stringToUTF8OnStack(l),_+=4}),HEAPU32[_>>2]=0;try{var o=t(r,n);return exitJS(o,!0),o}catch(l){return handleException(l)}}}a(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var r=Module.noInitialRun||!1;r||callMain(e),postRun()}}a(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}a(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}a(Ie,"Module");var K=Ie;var B=null;async function ie(e){if(B)return B;let{wasmModule:t,...r}=e??{};if(!t)return B??=await K(r);let n=new Promise((_,o)=>{r.instantiateWasm=(l,d)=>(WebAssembly.instantiate(t,l).then(m=>{d(m,t)}).catch(o),{})});return B??=await Promise.race([K(r),n])}a(ie,"initializeBinding");function le(){return!!B}a(le,"checkModule");var ue=4294967296,c,G,Y;function Ae(e){let t=s._ts_language_abi_version(e[0]);if(t<Y||t>G)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${G.toString(16)}.`)}a(Ae,"assertSupportedLanguage");var de=A(e=>{s._ts_parser_delete(e[0]),s._free(e[1])}),q=class{static{a(this,"Parser")}0=0;1=0;logCallback=null;loggerEnabled=!1;language=null;lastParseOperations=0;static async init(t){Q(await ie(t)),c=s._ts_init();let r=c>>>2;G=s.HEAP32[r],Y=s.HEAP32[r+1]}constructor(){this.initialize(),de?.register(this,[this[0],this[1]],this)}initialize(){if(!le())throw new Error("cannot construct a Parser before calling `init()`");s._ts_parser_new_wasm();let t=c>>>2;this[0]=s.HEAP32[t],this[1]=s.HEAP32[t+1],this.loggerEnabled=!1}delete(){de?.unregister(this),s._ts_parser_delete(this[0]),s._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===R)r=t[0],Ae(t),this.language=t;else throw new Error("Argument must be a Language");return s._ts_parser_set_language(this[0],r),this}parse(t,r,n){let _=Te(n?.maxMemoryBytes),o=Ee(n?.maxOperations);if(typeof t!="string"&&typeof t!="function")throw new Error("Argument must be a string or a function");let l=n?.progressCallback??null;s.currentParseCallback=t,s.currentProgressCallback=l,this.syncLogger(),this.lastParseOperations=0;try{let d=this.runParse(r,n,_,o);if(!d)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new L(w,d,this.language,t)}finally{Ne()}}syncLogger(){this.logCallback?(s.currentLogCallback=this.logCallback,this.loggerEnabled||(s._ts_parser_enable_logger_wasm(this[0],1),this.loggerEnabled=!0)):(s.currentLogCallback=null,this.loggerEnabled&&(s._ts_parser_enable_logger_wasm(this[0],0),this.loggerEnabled=!1))}runParse(t,r,n,_){if(n!==void 0&&!s.treeSitterSetMemoryLimit(n))return 0;try{let[o,l]=Se(r?.includedRanges);if(l&&!o)return 0;Re(_,o,l,r?.progressCallback?1:0);try{return n===void 0?this.executeOrdinaryParse(t?t[0]:0):this.executeLimitedParse()}finally{this.lastParseOperations=ke()}}finally{n!==void 0&&s.treeSitterSetMemoryLimit(0)}}executeOrdinaryParse(t){try{return s._ts_parser_parse_wasm(this[0],this[1],t)}catch(r){throw s._ts_parser_last_parse_operations_wasm(this[0]),r}}executeLimitedParse(){try{return s._ts_parser_parse_limited_wasm(this[0],this[1])}catch(t){throw s._ts_parser_abort_limited_wasm(),t}}reset(){s._ts_parser_reset(this[0])}getIncludedRanges(){return s._ts_parser_included_ranges_wasm(this[0]),U(!1)}setLogger(t){if(!t)this.logCallback=null;else{if(typeof t!="function")throw new Error("Logger callback must be a function");this.logCallback=t}return this}getLogger(){return this.logCallback}};function Te(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0||e>2147483647))throw new RangeError("maxMemoryBytes must be a positive integer no greater than 2147483647");return e}a(Te,"validateMemoryLimit");function Ee(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0))throw new RangeError("maxOperations must be a positive safe integer");return e}a(Ee,"validateOperationLimit");function Se(e){if(!e?.length)return[0,0];let t=s._calloc(e.length,x);if(!t)return[0,e.length];try{let r=t;for(let n of e)se(r,n),r+=x;return[t,e.length]}catch(r){throw s._free(t),r}}a(Se,"prepareRanges");function Re(e,t,r,n){let _=c>>>2,o=s.HEAPU32;o[_]=e===void 0?0:e>>>0,o[_+1]=e===void 0?0:Math.floor(e/ue)>>>0,o[_+2]=t,o[_+3]=r,o[_+4]=n}a(Re,"marshalParseInputs");function ke(){let e=c>>>2,t=s.HEAPU32;return t[e]+t[e+1]*ue}a(ke,"unmarshalOperationCount");function Ne(){s.currentParseCallback=null,s.currentLogCallback=null,s.currentProgressCallback=null}a(Ne,"clearCallbacks");export{$ as Edit,G as LANGUAGE_VERSION,R as Language,C as LookaheadIterator,Y as MIN_COMPATIBLE_VERSION,H as Node,q as Parser,L as Tree,S as TreeCursor};
|
|
3
|
+
${l}`)}let o=a.clone();try{r=await WebAssembly.compileStreaming(a)}catch(l){console.error("wasm streaming compile failed:",l),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let s=await _.loadWebAssemblyModule(r,{loadAsync:!0});return ne(s,{sync:!1})}static loadSync(t){let r=_.loadWebAssemblyModule(t,{loadAsync:!1});return ne(r,{sync:!0})}};function ne(e,{sync:t}){let r=Object.keys(e),s=r.find(o=>ve.test(o)&&!o.includes("external_scanner_"));if(!s)throw console.log(`Couldn't find language function in Wasm file. Symbols:
|
|
4
|
+
${JSON.stringify(r,null,2)}`),new Error(`Language.${t?"loadSync":"load"} failed: no language function found in Wasm file`);let a=e[s]();return new k(p,a)}n(ne,"loadFromWasmExports");async function Me(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await import("module");var require=e(import.meta.url)}Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null,Module.treeSitterSetMemoryLimit=function(e){return e?wasmMemory.buffer.byteLength>e||Module.treeSitterOriginalMemoryGrow?!1:(Module.treeSitterOriginalMemoryGrow=wasmMemory.grow,wasmMemory.grow=function(t){if(wasmMemory.buffer.byteLength+t*65536>e)throw new RangeError("Parse memory limit exceeded");return Module.treeSitterOriginalMemoryGrow.call(wasmMemory,t)},!0):(Module.treeSitterOriginalMemoryGrow&&(wasmMemory.grow=Module.treeSitterOriginalMemoryGrow,Module.treeSitterOriginalMemoryGrow=null),!0)};var arguments_=[],thisProgram="./this.program",quit_=n((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}n(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=n(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=n(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},"readAsync"),process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=n((e,t)=>{throw process.exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=n(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=n(async e=>{if(isFileURI(e))return new Promise((r,s)=>{var a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer",a.onload=()=>{if(a.status==200||a.status==0&&a.response){r(a.response);return}s(a.status)},a.onerror=s,a.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=n(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;HEAP8=new Int8Array(e),HEAP16=new Int16Array(e),HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),HEAPF32=new Float32Array(e),HEAPF64=new Float64Array(e),HEAP64=new BigInt64Array(e),HEAPU64=new BigUint64Array(e)}n(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||4194304;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}n(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}n(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}n(initRuntime,"initRuntime");function preMain(){}n(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}n(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}n(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}n(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}n(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}n(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),s=await WebAssembly.instantiate(r,t);return s}catch(a){err(`failed to asynchronously prepare wasm: ${a}`),abort(a)}}n(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var s=fetch(t,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(s,r);return a}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}n(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}n(getWasmImports,"getWasmImports");async function createWasm(){function e(o,l){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var d=getDylinkMetadata(l);d.neededDynlibs&&(dynamicLibraries=d.neededDynlibs.concat(dynamicLibraries));let m={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,m),updateGOT(m,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}n(e,"receiveInstance");function t(o){return e(o.instance,o.module)}n(t,"receiveInstantiationResult");var r=getWasmImports();if(Module.instantiateWasm)return new Promise((o,l)=>{Module.instantiateWasm(r,(d,m)=>{o(e(d,m))})});wasmBinaryFile??=findWasmBinary();var s=await instantiateAsync(wasmBinary,wasmBinaryFile,r),a=t(s);return a}n(createWasm,"createWasm");class ExitStatus{static{n(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=n(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=n(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=n(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=n((e,t,r,s)=>{var a=t+r;if(s)return a;for(;e[t]&&!(t>=a);)++t;return t},"findStringEnd"),UTF8ArrayToString=n((e,t=0,r,s)=>{var a=findStringEnd(e,t,r,s);if(a-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,a));for(var o="";t<a;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var d=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|d);continue}var m=e[t++]&63;if((l&240)==224?l=(l&15)<<12|d<<6|m:l=(l&7)<<18|d<<12|m<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var b=l-65536;o+=String.fromCharCode(55296|b>>10,56320|b&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=n(e=>{var t=0,r=0;function s(){return e[t++]}n(s,"getU8");function a(){for(var v=0,S=1;;){var Y=e[t++];if(v+=(Y&127)*S,S*=128,!(Y&128))break}return v}n(a,"getLEB");function o(){var v=a();return t+=v,UTF8ArrayToString(e,t-v,v)}n(o,"getString");function l(){for(var v=a(),S=[];v--;)S.push(o());return S}n(l,"getStringList");function d(v,S){if(v)throw new Error(S)}if(n(d,"failIf"),e instanceof WebAssembly.Module){var m=WebAssembly.Module.customSections(e,"dylink.0");d(m.length===0,"need dylink section"),e=new Uint8Array(m[0]),r=e.length}else{var b=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),y=b[0]==1836278016;d(!y,"need to see wasm magic number"),d(e[8]!==0,"need the dylink section to be first"),t=9;var g=a();r=t+g;var I=o();d(I!=="dylink.0")}for(var h={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},de=1,ue=2,me=3,ce=4,ge=5,fe=256,he=3,pe=1;t<r;){var N=s(),be=a();if(N===de)h.memorySize=a(),h.memoryAlign=a(),h.tableSize=a(),h.tableAlign=a();else if(N===ue)h.neededDynlibs=l();else if(N===me)for(var j=a();j--;){var z=o(),$=a();$&fe&&h.tlsExports.add(z)}else if(N===ce)for(var j=a();j--;){var Ne=o(),z=o(),$=a();($&he)==pe&&h.weakImports.add(z)}else N===ge?h.runtimePaths=l():t+=be}return h},"getDylinkMetadata"),newDSO=n((e,t,r)=>{var s={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=s,t!=null&&(LDSO.loadedLibsByHandle[t]=s),s},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82160,alignMemory=n((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=n(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},"getMemory"),isInternalSym=n(e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=n(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=n(e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),"generateTypePack"),convertJsFunctionToWasm=n((e,t)=>{var r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),s=new WebAssembly.Module(r),a=new WebAssembly.Instance(s,{e:{f:e}}),o=a.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:49,element:"anyfunc"}),getWasmTableEntry=n(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=n((e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var s=getWasmTableEntry(r);s&&functionsInTableMap.set(s,r)}},"updateTableMap"),functionsInTableMap,getFunctionAddress=n(e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=n(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=n((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=n((e,t)=>{var r=getFunctionAddress(e);if(r)return r;var s=getEmptyTableSlot();try{setWasmTableEntry(s,e)}catch(o){if(!(o instanceof TypeError))throw o;var a=convertJsFunctionToWasm(e,t);setWasmTableEntry(s,a)}return functionsInTableMap.set(e,s),s},"addFunction"),updateGOT=n((e,t)=>{for(var r in e)if(!isInternalSym(r)){var s=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof s=="function"?GOT[r].value=addFunction(s):typeof s=="number"?GOT[r].value=s:err(`unhandled export type for '${r}': ${typeof s}`))}},"updateGOT"),relocateExports=n((e,t,r)=>{var s={};for(var a in e){var o=e[a];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),s[a]=o}return updateGOT(s,r),s},"relocateExports"),isSymbolDefined=n(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=n((e,t,r=[],s=!1)=>{var a=getWasmTableEntry(t),o=a(...r);function l(d){return d}return n(l,"convert"),o},"dynCall"),stackSave=n(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=n(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=n(e=>(t,...r)=>{var s=stackSave();try{return dynCall(e,t,r)}catch(a){if(stackRestore(s),a!==a+0)throw a;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=n((e,t=!1)=>{var r;return isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=n(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=n((e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"","UTF8ToString"),loadWebAssemblyModule=n((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize),metadata.tableSize&&wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}n(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var r=wasmImports[t];return r}if(!(t in e)){var s;e[t]=(...a)=>(s||=resolveSymbol(t),s(...a))}return e[t]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(n(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}n(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(n(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=await WebAssembly.instantiate(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return n(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=n((e,t)=>{for(var[r,s]of Object.entries(e)){let a=n(l=>{isSymbolDefined(l)||(wasmImports[l]=s)},"setImport");a(r);let o="__main_argc_argv";r=="main"&&a(o),r==o&&a("main")}},"mergeLibSymbols"),asyncLoad=n(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,s){var a=LDSO.loadedLibsByName[e];if(a)return t.global?a.global||(a.global=!0,mergeLibSymbols(a.exports,e)):r&&Object.assign(r,a.exports),t.nodelete&&a.refcount!==1/0&&(a.refcount=1/0),a.refcount++,s&&(LDSO.loadedLibsByHandle[s]=a),t.loadAsync?Promise.resolve(!0):!0;a=newDSO(e,s,"loading"),a.refcount=t.nodelete?1/0:1,a.global=t.global;function o(){if(s){var m=HEAPU32[s+28>>2],b=HEAPU32[s+32>>2];if(m&&b){var y=HEAP8.slice(m,m+b);return t.loadAsync?Promise.resolve(y):y}}var g=locateFile(e);if(t.loadAsync)return asyncLoad(g);if(!readBinary)throw new Error(`${g}: file not found, and synchronous loading of external files is not available`);return readBinary(g)}n(o,"loadLibData");function l(){return t.loadAsync?o().then(m=>loadWebAssemblyModule(m,t,e,r,s)):loadWebAssemblyModule(o(),t,e,r,s)}n(l,"getExports");function d(m){a.global?mergeLibSymbols(m,e):r&&Object.assign(r,m),a.exports=m}return n(d,"moduleLoaded"),t.loadAsync?l().then(m=>(d(m),!0)):(d(l()),!0)}n(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=n(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error(`bad export type for '${e}': ${typeof r}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=n(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=n(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=n(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0,___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82160,___stack_low=16624,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82160),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=n(()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},"__emscripten_runtime_keepalive_clear");__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=n(()=>{throw 1/0},"__emscripten_throw_longjmp");__emscripten_throw_longjmp.sig="v";var timers={},handleException=n(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),keepRuntimeAlive=n(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=n(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=n((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),_exit=exitJS;_exit.sig="vi";var maybeExit=n(()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},"maybeExit"),callUserCallback=n(e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},"callUserCallback"),_emscripten_get_now=n(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var __setitimer_js=n((e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0},"__setitimer_js");__setitimer_js.sig="iid";var getHeapMax=n(()=>2147483648,"getHeapMax"),growMemory=n(e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=n(e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var s=1;s<=4;s*=2){var a=t*(1+0/s);a=Math.min(a,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,a),65536)),l=growMemory(o);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}n(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,r,s,a,o){let l=Module.currentParseCallback,d=typeof l=="string",m=d?l:l(r,{row:s,column:a}),b=d?r:0,y=typeof m=="string"?m.length-b:0;if(y<=0){HEAP32[o>>>2]=0;return}let g=y<t?y:t;if(g<y&&g>1){let h=m.charCodeAt(b+g-1);h>=55296&&h<=56319&&g--}let I=e>>>1;for(let h=0;h<g;h++)HEAPU16[I+h]=m.charCodeAt(b+h);HEAP32[o>>>2]=g}n(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}n(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");var lengthBytesUTF8=n(e=>{for(var t=0,r=0;r<e.length;++r){var s=e.charCodeAt(r);s<=127?t++:s<=2047?t+=2:s>=55296&&s<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=n((e,t,r,s)=>{if(!(s>0))return 0;for(var a=r,o=r+s-1,l=0;l<e.length;++l){var d=e.codePointAt(l);if(d<=127){if(r>=o)break;t[r++]=d}else if(d<=2047){if(r+1>=o)break;t[r++]=192|d>>6,t[r++]=128|d&63}else if(d<=65535){if(r+2>=o)break;t[r++]=224|d>>12,t[r++]=128|d>>6&63,t[r++]=128|d&63}else{if(r+3>=o)break;t[r++]=240|d>>18,t[r++]=128|d>>12&63,t[r++]=128|d>>6&63,t[r++]=128|d&63,l++}}return t[r]=0,r-a},"stringToUTF8Array"),stringToUTF8=n((e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),"stringToUTF8"),stackAlloc=n(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=n(e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},"stringToUTF8OnStack"),AsciiToString=n(e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},"AsciiToString");if(initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.loadWebAssemblyModule=loadWebAssemblyModule;var ASM_CONSTS={},_free,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_memcmp,_ts_tree_cursor_current_descendant_index,_ts_tree_cursor_current_depth,_ts_tree_copy,_ts_tree_delete,_malloc,_calloc,_realloc,_ts_init,_ts_free_wasm,_ts_scanner_malloc_wasm,_ts_scanner_calloc_wasm,_ts_scanner_realloc_wasm,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_parse_limited_wasm,_ts_parser_last_parse_operations_wasm,_ts_parser_abort_limited_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_included_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_end_point_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_memcpy,_memmove,_memset,_iswalnum,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswspace,_iswupper,_iswxdigit,_memchr,__emscripten_timeout,_strcmp,_strlen,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._free=_free=e.free,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._memcmp=_memcmp=e.memcmp,Module._ts_tree_cursor_current_descendant_index=_ts_tree_cursor_current_descendant_index=e.ts_tree_cursor_current_descendant_index,Module._ts_tree_cursor_current_depth=_ts_tree_cursor_current_depth=e.ts_tree_cursor_current_depth,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._ts_init=_ts_init=e.ts_init,Module._ts_free_wasm=_ts_free_wasm=e.ts_free_wasm,Module._ts_scanner_malloc_wasm=_ts_scanner_malloc_wasm=e.ts_scanner_malloc_wasm,Module._ts_scanner_calloc_wasm=_ts_scanner_calloc_wasm=e.ts_scanner_calloc_wasm,Module._ts_scanner_realloc_wasm=_ts_scanner_realloc_wasm=e.ts_scanner_realloc_wasm,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_parse_limited_wasm=_ts_parser_parse_limited_wasm=e.ts_parser_parse_limited_wasm,Module._ts_parser_last_parse_operations_wasm=_ts_parser_last_parse_operations_wasm=e.ts_parser_last_parse_operations_wasm,Module._ts_parser_abort_limited_wasm=_ts_parser_abort_limited_wasm=e.ts_parser_abort_limited_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=e.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=e.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._memset=_memset=e.memset,Module._iswalnum=_iswalnum=e.iswalnum,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswspace=_iswspace=e.iswspace,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,__emscripten_timeout=e._emscripten_timeout,Module._strcmp=_strcmp=e.strcmp,Module._strlen=_strlen=e.strlen,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}n(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_setitimer_js:__setitimer_js,emscripten_resize_heap:_emscripten_resize_heap,invoke_i,invoke_iii,invoke_vi,invoke_vii,invoke_viii,memory:wasmMemory,proc_exit:_proc_exit,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback};function invoke_iii(e,t,r){var s=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(s),a!==a+0)throw a;_setThrew(1,0)}}n(invoke_iii,"invoke_iii");function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(s){if(stackRestore(r),s!==s+0)throw s;_setThrew(1,0)}}n(invoke_vi,"invoke_vi");function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}n(invoke_i,"invoke_i");function invoke_viii(e,t,r,s){var a=stackSave();try{getWasmTableEntry(e)(t,r,s)}catch(o){if(stackRestore(a),o!==o+0)throw o;_setThrew(1,0)}}n(invoke_viii,"invoke_viii");function invoke_vii(e,t,r){var s=stackSave();try{getWasmTableEntry(e)(t,r)}catch(a){if(stackRestore(s),a!==a+0)throw a;_setThrew(1,0)}}n(invoke_vii,"invoke_vii");function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,s=stackAlloc((r+1)*4),a=s;e.forEach(l=>{HEAPU32[a>>2]=stringToUTF8OnStack(l),a+=4}),HEAPU32[a>>2]=0;try{var o=t(r,s);return exitJS(o,!0),o}catch(l){return handleException(l)}}}n(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var r=Module.noInitialRun||!1;r||callMain(e),postRun()}}n(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}n(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}n(Me,"Module");var K=Me;var H=null;async function ae(e){if(H)return H;let{wasmModule:t,...r}=e??{};if(!t)return H??=await K(r);let s=new Promise((a,o)=>{r.instantiateWasm=(l,d)=>(WebAssembly.instantiate(t,l).then(m=>{d(m,t)}).catch(o),{})});return H??=await Promise.race([K(r),s])}n(ae,"initializeBinding");function oe(){return!!H}n(oe,"checkModule");var le=4294967296,c,G,X;function Te(e){let t=_._ts_language_abi_version(e[0]);if(t<X||t>G)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${G.toString(16)}.`)}n(Te,"assertSupportedLanguage");var ie=P(e=>{_._ts_parser_delete(e[0]),_._free(e[1])}),q=class{static{n(this,"Parser")}0=0;1=0;logCallback=null;loggerEnabled=!1;language=null;lastParseOperations=0;static async init(t){J(await ae(t)),c=_._ts_init();let r=c>>>2;G=_.HEAP32[r],X=_.HEAP32[r+1]}constructor(){this.initialize(),ie?.register(this,[this[0],this[1]],this)}initialize(){if(!oe())throw new Error("cannot construct a Parser before calling `init()`");_._ts_parser_new_wasm();let t=c>>>2;this[0]=_.HEAP32[t],this[1]=_.HEAP32[t+1],this.loggerEnabled=!1}delete(){ie?.unregister(this),_._ts_parser_delete(this[0]),_._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===k)r=t[0],Te(t),this.language=t;else throw new Error("Argument must be a Language");return _._ts_parser_set_language(this[0],r),this}parse(t,r){let s=Ae(r?.maxMemoryBytes),a=Pe(r?.maxOperations);if(typeof t!="string"&&typeof t!="function")throw new Error("Argument must be a string or a function");let o=r?.progressCallback??null;_.currentParseCallback=t,_.currentProgressCallback=o,this.syncLogger(),this.lastParseOperations=0;try{let l=this.runParse(r,s,a);if(!l)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new U(p,l,this.language,t)}finally{ke()}}syncLogger(){this.logCallback?(_.currentLogCallback=this.logCallback,this.loggerEnabled||(_._ts_parser_enable_logger_wasm(this[0],1),this.loggerEnabled=!0)):(_.currentLogCallback=null,this.loggerEnabled&&(_._ts_parser_enable_logger_wasm(this[0],0),this.loggerEnabled=!1))}runParse(t,r,s){if(r!==void 0&&!_.treeSitterSetMemoryLimit(r))return 0;try{let[a,o]=Ie(t?.includedRanges);if(o&&!a)return 0;Se(s,a,o,t?.progressCallback?1:0);try{return r===void 0?this.executeOrdinaryParse():this.executeLimitedParse()}finally{this.lastParseOperations=Re()}}finally{r!==void 0&&_.treeSitterSetMemoryLimit(0)}}executeOrdinaryParse(){try{return _._ts_parser_parse_wasm(this[0],this[1])}catch(t){throw _._ts_parser_last_parse_operations_wasm(this[0]),t}}executeLimitedParse(){try{return _._ts_parser_parse_limited_wasm(this[0],this[1])}catch(t){throw _._ts_parser_abort_limited_wasm(),t}}reset(){_._ts_parser_reset(this[0])}getIncludedRanges(){return _._ts_parser_included_ranges_wasm(this[0]),D(!1)}setLogger(t){if(!t)this.logCallback=null;else{if(typeof t!="function")throw new Error("Logger callback must be a function");this.logCallback=t}return this}getLogger(){return this.logCallback}};function Ae(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0||e>2147483647))throw new RangeError("maxMemoryBytes must be a positive integer no greater than 2147483647");return e}n(Ae,"validateMemoryLimit");function Pe(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0))throw new RangeError("maxOperations must be a positive safe integer");return e}n(Pe,"validateOperationLimit");function Ie(e){if(!e?.length)return[0,0];let t=_._calloc(e.length,F);if(!t)return[0,e.length];try{let r=t;for(let s of e)re(r,s),r+=F;return[t,e.length]}catch(r){throw _._free(t),r}}n(Ie,"prepareRanges");function Se(e,t,r,s){let a=c>>>2,o=_.HEAPU32;o[a]=e===void 0?0:e>>>0,o[a+1]=e===void 0?0:Math.floor(e/le)>>>0,o[a+2]=t,o[a+3]=r,o[a+4]=s}n(Se,"marshalParseInputs");function Re(){let e=c>>>2,t=_.HEAPU32;return t[e]+t[e+1]*le}n(Re,"unmarshalOperationCount");function ke(){_.currentParseCallback=null,_.currentLogCallback=null,_.currentProgressCallback=null}n(ke,"clearCallbacks");export{G as LANGUAGE_VERSION,k as Language,O as LookaheadIterator,X as MIN_COMPATIBLE_VERSION,W as Node,q as Parser,U as Tree,R as TreeCursor};
|
|
5
5
|
//# sourceMappingURL=web-tree-sitter.js.map
|