@willbooster/web-tree-sitter 20.0.0 → 22.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 +3 -3
- package/debug/web-tree-sitter.cjs +111 -221
- package/debug/web-tree-sitter.cjs.map +4 -4
- package/debug/web-tree-sitter.js +111 -220
- package/debug/web-tree-sitter.js.map +4 -4
- package/debug/web-tree-sitter.wasm +0 -0
- package/debug/web-tree-sitter.wasm.map +19 -15
- package/package.json +6 -6
- package/web-tree-sitter.cjs +3 -3
- package/web-tree-sitter.cjs.map +4 -4
- package/web-tree-sitter.d.cts +1 -70
- package/web-tree-sitter.d.cts.map +3 -6
- package/web-tree-sitter.d.ts +1 -70
- package/web-tree-sitter.d.ts.map +3 -6
- 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 +23 -19
- package/web-tree-sitter.web.js +3 -3
- package/web-tree-sitter.web.js.map +4 -4
package/web-tree-sitter.d.cts
CHANGED
|
@@ -120,8 +120,7 @@
|
|
|
120
120
|
export let LANGUAGE_VERSION: number;
|
|
121
121
|
/**
|
|
122
122
|
* The earliest ABI version that is supported by the current version of the
|
|
123
|
-
* library.
|
|
124
|
-
* so the library loads both.
|
|
123
|
+
* library.
|
|
125
124
|
*/
|
|
126
125
|
export let MIN_COMPATIBLE_VERSION: number;
|
|
127
126
|
/**
|
|
@@ -270,27 +269,6 @@
|
|
|
270
269
|
* Get the subtype ids for a given supertype node id.
|
|
271
270
|
*/
|
|
272
271
|
subtypes(supertype: number): number[];
|
|
273
|
-
/**
|
|
274
|
-
* Get the next state id for a given state id and node type id.
|
|
275
|
-
*/
|
|
276
|
-
nextState(stateId: number, typeId: number): number;
|
|
277
|
-
/**
|
|
278
|
-
* Create a new lookahead iterator for this language and parse state.
|
|
279
|
-
*
|
|
280
|
-
* This returns `null` if state is invalid for this language.
|
|
281
|
-
*
|
|
282
|
-
* Iterating {@link LookaheadIterator} will yield valid symbols in the given
|
|
283
|
-
* parse state. A newly created iterator is not positioned on a symbol, so
|
|
284
|
-
* {@link LookaheadIterator#currentType} returns `null` until the first
|
|
285
|
-
* iteration step.
|
|
286
|
-
*
|
|
287
|
-
* Lookahead iterators can be useful for generating suggestions and improving
|
|
288
|
-
* syntax error diagnostics. To get symbols valid in an `ERROR` node, use the
|
|
289
|
-
* lookahead iterator on its first leaf node state. For `MISSING` nodes, a
|
|
290
|
-
* lookahead iterator created on the previous non-extra leaf node may be
|
|
291
|
-
* appropriate.
|
|
292
|
-
*/
|
|
293
|
-
lookaheadIterator(stateId: number): LookaheadIterator | null;
|
|
294
272
|
/**
|
|
295
273
|
* Load a language from a WebAssembly module.
|
|
296
274
|
* The module can be provided as a path to a file, a `URL` to a file, a
|
|
@@ -391,10 +369,6 @@
|
|
|
391
369
|
get endPosition(): Point;
|
|
392
370
|
/** Get the string content of this node. */
|
|
393
371
|
get text(): string;
|
|
394
|
-
/** Get this node's parse state. */
|
|
395
|
-
get parseState(): number;
|
|
396
|
-
/** Get the parse state after this node. */
|
|
397
|
-
get nextParseState(): number;
|
|
398
372
|
/** Check if this node is equal to another node. */
|
|
399
373
|
equals(other: Node): boolean;
|
|
400
374
|
/**
|
|
@@ -570,8 +544,6 @@
|
|
|
570
544
|
get nodeType(): string;
|
|
571
545
|
/** Get the type id of the cursor's current node. */
|
|
572
546
|
get nodeTypeId(): number;
|
|
573
|
-
/** Get the state id of the cursor's current node. */
|
|
574
|
-
get nodeStateId(): number;
|
|
575
547
|
/** Get the id of the cursor's current node. */
|
|
576
548
|
get nodeId(): number;
|
|
577
549
|
/**
|
|
@@ -686,47 +658,6 @@
|
|
|
686
658
|
*/
|
|
687
659
|
resetTo(cursor: TreeCursor): void;
|
|
688
660
|
}
|
|
689
|
-
export class LookaheadIterator implements Iterable<string> {
|
|
690
|
-
/**
|
|
691
|
-
* Get the current symbol of the lookahead iterator.
|
|
692
|
-
*
|
|
693
|
-
* Returns `null` if the iterator is not positioned on a symbol:
|
|
694
|
-
*
|
|
695
|
-
* - Before the first iteration step
|
|
696
|
-
* - After the iterator is exhausted
|
|
697
|
-
* - After a {@link reset} or {@link resetState} call
|
|
698
|
-
*/
|
|
699
|
-
get currentTypeId(): number | null;
|
|
700
|
-
/**
|
|
701
|
-
* Get the current symbol name of the lookahead iterator.
|
|
702
|
-
*
|
|
703
|
-
* Returns `null` if the iterator is not positioned on a symbol.
|
|
704
|
-
*/
|
|
705
|
-
get currentType(): string | null;
|
|
706
|
-
/** Delete the lookahead iterator, freeing its resources. */
|
|
707
|
-
delete(): void;
|
|
708
|
-
/**
|
|
709
|
-
* Reset the lookahead iterator.
|
|
710
|
-
*
|
|
711
|
-
* This returns `true` if the language was set successfully and `false`
|
|
712
|
-
* otherwise.
|
|
713
|
-
*/
|
|
714
|
-
reset(language: Language, stateId: number): boolean;
|
|
715
|
-
/**
|
|
716
|
-
* Reset the lookahead iterator to another state.
|
|
717
|
-
*
|
|
718
|
-
* This returns `true` if the iterator was reset to the given state and
|
|
719
|
-
* `false` otherwise.
|
|
720
|
-
*/
|
|
721
|
-
resetState(stateId: number): boolean;
|
|
722
|
-
/**
|
|
723
|
-
* Returns an iterator that iterates over the symbols of the lookahead iterator.
|
|
724
|
-
*
|
|
725
|
-
* The iterator will yield the current symbol name as a string for each step
|
|
726
|
-
* until there are no more symbols to iterate over.
|
|
727
|
-
*/
|
|
728
|
-
[Symbol.iterator](): Iterator<string>;
|
|
729
|
-
}
|
|
730
661
|
|
|
731
662
|
export {};
|
|
732
663
|
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"Language",
|
|
18
18
|
"Tree",
|
|
19
19
|
"Node",
|
|
20
|
-
"TreeCursor"
|
|
21
|
-
"LookaheadIterator"
|
|
20
|
+
"TreeCursor"
|
|
22
21
|
],
|
|
23
22
|
"sources": [
|
|
24
23
|
"src/constants.ts",
|
|
@@ -27,8 +26,7 @@
|
|
|
27
26
|
"src/language.ts",
|
|
28
27
|
"src/tree.ts",
|
|
29
28
|
"src/node.ts",
|
|
30
|
-
"src/tree_cursor.ts"
|
|
31
|
-
"src/lookahead_iterator.ts"
|
|
29
|
+
"src/tree_cursor.ts"
|
|
32
30
|
],
|
|
33
31
|
"sourcesContent": [
|
|
34
32
|
null,
|
|
@@ -37,9 +35,8 @@
|
|
|
37
35
|
null,
|
|
38
36
|
null,
|
|
39
37
|
null,
|
|
40
|
-
null,
|
|
41
38
|
null
|
|
42
39
|
],
|
|
43
|
-
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA
|
|
40
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;YAMhBC,sBAAsBA;;;;;cA0BpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCtHFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCsBRC,IAAIA;;;;;;;;;;;;;;;;;;;;cC7BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCCJC,UAAUA",
|
|
44
41
|
"ignoreList": []
|
|
45
42
|
}
|
package/web-tree-sitter.d.ts
CHANGED
|
@@ -120,8 +120,7 @@
|
|
|
120
120
|
export let LANGUAGE_VERSION: number;
|
|
121
121
|
/**
|
|
122
122
|
* The earliest ABI version that is supported by the current version of the
|
|
123
|
-
* library.
|
|
124
|
-
* so the library loads both.
|
|
123
|
+
* library.
|
|
125
124
|
*/
|
|
126
125
|
export let MIN_COMPATIBLE_VERSION: number;
|
|
127
126
|
/**
|
|
@@ -270,27 +269,6 @@
|
|
|
270
269
|
* Get the subtype ids for a given supertype node id.
|
|
271
270
|
*/
|
|
272
271
|
subtypes(supertype: number): number[];
|
|
273
|
-
/**
|
|
274
|
-
* Get the next state id for a given state id and node type id.
|
|
275
|
-
*/
|
|
276
|
-
nextState(stateId: number, typeId: number): number;
|
|
277
|
-
/**
|
|
278
|
-
* Create a new lookahead iterator for this language and parse state.
|
|
279
|
-
*
|
|
280
|
-
* This returns `null` if state is invalid for this language.
|
|
281
|
-
*
|
|
282
|
-
* Iterating {@link LookaheadIterator} will yield valid symbols in the given
|
|
283
|
-
* parse state. A newly created iterator is not positioned on a symbol, so
|
|
284
|
-
* {@link LookaheadIterator#currentType} returns `null` until the first
|
|
285
|
-
* iteration step.
|
|
286
|
-
*
|
|
287
|
-
* Lookahead iterators can be useful for generating suggestions and improving
|
|
288
|
-
* syntax error diagnostics. To get symbols valid in an `ERROR` node, use the
|
|
289
|
-
* lookahead iterator on its first leaf node state. For `MISSING` nodes, a
|
|
290
|
-
* lookahead iterator created on the previous non-extra leaf node may be
|
|
291
|
-
* appropriate.
|
|
292
|
-
*/
|
|
293
|
-
lookaheadIterator(stateId: number): LookaheadIterator | null;
|
|
294
272
|
/**
|
|
295
273
|
* Load a language from a WebAssembly module.
|
|
296
274
|
* The module can be provided as a path to a file, a `URL` to a file, a
|
|
@@ -391,10 +369,6 @@
|
|
|
391
369
|
get endPosition(): Point;
|
|
392
370
|
/** Get the string content of this node. */
|
|
393
371
|
get text(): string;
|
|
394
|
-
/** Get this node's parse state. */
|
|
395
|
-
get parseState(): number;
|
|
396
|
-
/** Get the parse state after this node. */
|
|
397
|
-
get nextParseState(): number;
|
|
398
372
|
/** Check if this node is equal to another node. */
|
|
399
373
|
equals(other: Node): boolean;
|
|
400
374
|
/**
|
|
@@ -570,8 +544,6 @@
|
|
|
570
544
|
get nodeType(): string;
|
|
571
545
|
/** Get the type id of the cursor's current node. */
|
|
572
546
|
get nodeTypeId(): number;
|
|
573
|
-
/** Get the state id of the cursor's current node. */
|
|
574
|
-
get nodeStateId(): number;
|
|
575
547
|
/** Get the id of the cursor's current node. */
|
|
576
548
|
get nodeId(): number;
|
|
577
549
|
/**
|
|
@@ -686,47 +658,6 @@
|
|
|
686
658
|
*/
|
|
687
659
|
resetTo(cursor: TreeCursor): void;
|
|
688
660
|
}
|
|
689
|
-
export class LookaheadIterator implements Iterable<string> {
|
|
690
|
-
/**
|
|
691
|
-
* Get the current symbol of the lookahead iterator.
|
|
692
|
-
*
|
|
693
|
-
* Returns `null` if the iterator is not positioned on a symbol:
|
|
694
|
-
*
|
|
695
|
-
* - Before the first iteration step
|
|
696
|
-
* - After the iterator is exhausted
|
|
697
|
-
* - After a {@link reset} or {@link resetState} call
|
|
698
|
-
*/
|
|
699
|
-
get currentTypeId(): number | null;
|
|
700
|
-
/**
|
|
701
|
-
* Get the current symbol name of the lookahead iterator.
|
|
702
|
-
*
|
|
703
|
-
* Returns `null` if the iterator is not positioned on a symbol.
|
|
704
|
-
*/
|
|
705
|
-
get currentType(): string | null;
|
|
706
|
-
/** Delete the lookahead iterator, freeing its resources. */
|
|
707
|
-
delete(): void;
|
|
708
|
-
/**
|
|
709
|
-
* Reset the lookahead iterator.
|
|
710
|
-
*
|
|
711
|
-
* This returns `true` if the language was set successfully and `false`
|
|
712
|
-
* otherwise.
|
|
713
|
-
*/
|
|
714
|
-
reset(language: Language, stateId: number): boolean;
|
|
715
|
-
/**
|
|
716
|
-
* Reset the lookahead iterator to another state.
|
|
717
|
-
*
|
|
718
|
-
* This returns `true` if the iterator was reset to the given state and
|
|
719
|
-
* `false` otherwise.
|
|
720
|
-
*/
|
|
721
|
-
resetState(stateId: number): boolean;
|
|
722
|
-
/**
|
|
723
|
-
* Returns an iterator that iterates over the symbols of the lookahead iterator.
|
|
724
|
-
*
|
|
725
|
-
* The iterator will yield the current symbol name as a string for each step
|
|
726
|
-
* until there are no more symbols to iterate over.
|
|
727
|
-
*/
|
|
728
|
-
[Symbol.iterator](): Iterator<string>;
|
|
729
|
-
}
|
|
730
661
|
|
|
731
662
|
export {};
|
|
732
663
|
|
package/web-tree-sitter.d.ts.map
CHANGED
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"Language",
|
|
18
18
|
"Tree",
|
|
19
19
|
"Node",
|
|
20
|
-
"TreeCursor"
|
|
21
|
-
"LookaheadIterator"
|
|
20
|
+
"TreeCursor"
|
|
22
21
|
],
|
|
23
22
|
"sources": [
|
|
24
23
|
"src/constants.ts",
|
|
@@ -27,8 +26,7 @@
|
|
|
27
26
|
"src/language.ts",
|
|
28
27
|
"src/tree.ts",
|
|
29
28
|
"src/node.ts",
|
|
30
|
-
"src/tree_cursor.ts"
|
|
31
|
-
"src/lookahead_iterator.ts"
|
|
29
|
+
"src/tree_cursor.ts"
|
|
32
30
|
],
|
|
33
31
|
"sourcesContent": [
|
|
34
32
|
null,
|
|
@@ -37,9 +35,8 @@
|
|
|
37
35
|
null,
|
|
38
36
|
null,
|
|
39
37
|
null,
|
|
40
|
-
null,
|
|
41
38
|
null
|
|
42
39
|
],
|
|
43
|
-
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA
|
|
40
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;YAMhBC,sBAAsBA;;;;;cA0BpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCtHFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCsBRC,IAAIA;;;;;;;;;;;;;;;;;;;;cC7BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCCJC,UAAUA",
|
|
44
41
|
"ignoreList": []
|
|
45
42
|
}
|
package/web-tree-sitter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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}.
|
|
1
|
+
var v=4,p=9*v,E=2*v,N=2*v+2*E,z={row:0,column:0},f=Symbol("INTERNAL");function A(e){if(e!==f)throw new Error("Illegal constructor")}function k(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}function X(e){_=e}var _;function I(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}var J=I(e=>{_._ts_tree_cursor_delete_wasm(e)}),P=class e{0=0;tree;_nodeTypeId=0;_fieldId=0;_startIndex=0;_endIndex=0;_flags=0;constructor(t,r,n){A(t),this[0]=n,this.tree=r,this.readNodeCache(),J?.register(this,n,this)}copy(){let t=_._ts_tree_cursor_copy_wasm(this[0]);return new e(f,this.tree,t)}delete(){J?.unregister(this),_._ts_tree_cursor_delete_wasm(this[0]),this[0]=0}get currentNode(){return _._ts_tree_cursor_current_node_wasm(this[0]),c(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 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):U(t,this._startIndex,this._endIndex,this.startPosition)}get startPosition(){return _._ts_tree_cursor_start_position_wasm(this[0]),$(m)}get endPosition(){return _._ts_tree_cursor_end_position_wasm(this[0]),$(m)}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=m>>>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 U(e,t,r,n){let s=r-t,a=e(t,n);if(a){for(t+=a.length;t<r;){let o=e(t,n);if(o&&o.length>0)t+=o.length,a+=o;else break}t>r&&(a=a.slice(0,s))}return a??""}var Q=I(e=>{_._ts_tree_delete(e)}),C=class e{0=0;textSource;language;constructor(t,r,n,s){A(t),this[0]=r,this.language=n,this.textSource=s,Q?.register(this,r,this)}copy(){let t=_._ts_tree_copy(this[0]);return new e(f,t,this.language,this.textSource)}delete(){Q?.unregister(this),_._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return _._ts_tree_root_node_wasm(this[0]),c(this)}rootNodeWithOffset(t,r){let n=m+p;return _.HEAP32[n>>>2]=t,M(n+v,r),_._ts_tree_root_node_with_offset_wasm(this[0]),c(this)}walk(){_._ts_tree_root_node_wasm(this[0]);let t=_._ts_tree_cursor_new_wasm(this[0]);return new P(f,this,t)}getIncludedRanges(){return _._ts_tree_included_ranges_wasm(this[0]),x()}};var W=new Uint32Array(0),ee=new WeakMap,O=class{0=0;_endIndex;_endRow;_endColumn;_flags;_children;_namedChildren;constructor(t,{id:r,tree:n,startIndex:s,startPosition:a,other:o,endIndex:l,endRow:d,endColumn:h,flags:w}){A(t),this[0]=o,this.id=r,this.tree=n,this.startIndex=s,this.startPosition=a,this._endIndex=l,this._endRow=d,this._endColumn=h,this._flags=w}id;startIndex;startPosition;tree;get typeId(){return this._flags&65535}get grammarId(){return u(this),_._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this._flags&65535]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return(this._flags&65536)!==0}get isExtra(){return(this._flags&131072)!==0}get isError(){return(this._flags&1048576)!==0}get isMissing(){return(this._flags&262144)!==0}get hasError(){return(this._flags&524288)!==0}get endIndex(){return this._endIndex}get endPosition(){return{row:this._endRow,column:this._endColumn}}get text(){let{textSource:t}=this.tree;return typeof t=="string"?t.slice(this.startIndex,this._endIndex):U(t,this.startIndex,this._endIndex,this.startPosition)}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return u(this),_._ts_node_child_wasm(this.tree[0],t),c(this.tree)}namedChild(t){return u(this),_._ts_node_named_child_wasm(this.tree[0],t),c(this.tree)}childForFieldId(t){return u(this),_._ts_node_child_by_field_id_wasm(this.tree[0],t),c(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),F(this.tree,!0)}firstChildForIndex(t){u(this);let r=m+p;return _.HEAP32[r>>>2]=t,_._ts_node_first_child_for_byte_wasm(this.tree[0]),c(this.tree)}firstNamedChildForIndex(t){u(this);let r=m+p;return _.HEAP32[r>>>2]=t,_._ts_node_first_named_child_for_byte_wasm(this.tree[0]),c(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=F(this.tree)),this._children}get namedChildren(){return this._namedChildren||(u(this),_._ts_node_named_children_wasm(this.tree[0]),this._namedChildren=F(this.tree)),this._namedChildren}descendantsOfType(t,r=z,n=z){let s=be(this.tree.language,t);if(s.length===0)return[];let a=_._malloc(v*s.length);_.HEAPU32.set(s,a>>>2),u(this);let o=m+p;M(o,r),M(o+E,n),_._ts_node_descendants_of_type_wasm(this.tree[0],a,s.length);let l=F(this.tree,!0);return _._free(a),l}get nextSibling(){return u(this),_._ts_node_next_sibling_wasm(this.tree[0]),c(this.tree)}get previousSibling(){return u(this),_._ts_node_prev_sibling_wasm(this.tree[0]),c(this.tree)}get nextNamedSibling(){return u(this),_._ts_node_next_named_sibling_wasm(this.tree[0]),c(this.tree)}get previousNamedSibling(){return u(this),_._ts_node_prev_named_sibling_wasm(this.tree[0]),c(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]),c(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(u(this),u(t,1),_._ts_node_child_with_descendant_wasm(this.tree[0]),c(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let n=m+p>>>2,s=_.HEAP32;return s[n]=t,s[n+1]=r,_._ts_node_descendant_for_index_wasm(this.tree[0]),c(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");u(this);let n=m+p>>>2,s=_.HEAP32;return s[n]=t,s[n+1]=r,_._ts_node_named_descendant_for_index_wasm(this.tree[0]),c(this.tree)}descendantForPosition(t,r=t){if(!k(t)||!k(r))throw new Error("Arguments must be {row, column} objects");u(this);let n=m+p;return M(n,t),M(n+E,r),_._ts_node_descendant_for_position_wasm(this.tree[0]),c(this.tree)}namedDescendantForPosition(t,r=t){if(!k(t)||!k(r))throw new Error("Arguments must be {row, column} objects");u(this);let n=m+p;return M(n,t),M(n+E,r),_._ts_node_named_descendant_for_position_wasm(this.tree[0]),c(this.tree)}walk(){u(this);let t=_._ts_tree_cursor_new_wasm(this.tree[0]);return new P(f,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 be(e,t){let r=we(e);return typeof t=="string"?r.get(t)??W:t.length===0?W:t.length===1?r.get(t[0])??W:ve(r,t)}function we(e){let t=ee.get(e);return t||(t=ye(e.types),ee.set(e,t)),t}function ye(e){let t=new Map;for(let s=0,a=e.length;s<a;s++){let o=e[s];if(o!==void 0){let l=t.get(o);l||(l=[],t.set(o,l)),l.push(s)}}let r=t.get("ERROR");r?r[r.length-1]!==65535&&r.push(65535):t.set("ERROR",[65535]);let n=new Map;for(let[s,a]of t)n.set(s,Uint32Array.from(a));return n}function ve(e,t){let r=[];for(let n of new Set(t)){let s=e.get(n);if(s)for(let a of s)r.push(a)}return r.length===0?W:Uint32Array.from(r).sort()}function u(e,t=0){let r=m+t*p>>>2,n=_.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]}function c(e,t=m){let r=t>>>2,n=_.HEAP32,s=n[r];if(s===0)return null;let a=_.HEAPU32;return new O(f,{id:s,tree:e,startIndex:a[r+1],startPosition:{row:a[r+2],column:a[r+3]},other:n[r+4],endIndex:a[r+5],endRow:a[r+6],endColumn:a[r+7],flags:a[r+8]})}function M(e,t){let r=e>>>2,n=_.HEAP32;n[r]=t.row,n[r+1]=t.column}function $(e){let t=e>>>2,r=_.HEAPU32;return{row:r[t],column:r[t+1]}}function te(e,t){let r=e>>>2,n=_.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}function Me(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]}}function re(e){let t=e>>>2,r=_.HEAP32;return{major_version:r[t],minor_version:r[t+1],patch_version:r[t+2]}}function V(){let e=m>>>2,t=_.HEAPU32[e],r=_.HEAPU32[e+1],n=new Array(t);if(t>0){let s=r>>>1,a=_.HEAPU16;for(let o=0;o<t;o++)n[o]=a[s+o]}return n}function x(e=!0){return ne(N,Me,e)}function F(e,t=!1){return ne(p,r=>c(e,r),t)}function ne(e,t,r){let n=m>>>2,s=_.HEAPU32[n],a=_.HEAP32[n+1],o=new Array(s);for(let l=0,d=a;l<s;l++,d+=e)o[l]=t(d);return a&&(r?_._ts_free_wasm(a):_._free(a)),o}var Ae=/^tree_sitter_\w+$/,S=class{0=0;types;fields;constructor(t,r){A(t),this[0]=r,this.types=new Array(_._ts_language_symbol_count(this[0]));for(let n=0,s=this.types.length;n<s;n++)_._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=_.UTF8ToString(_._ts_language_symbol_name(this[0],n)));this.fields=new Array(_._ts_language_field_count(this[0])+1);for(let n=0,s=this.fields.length;n<s;n++){let a=_._ts_language_field_name_for_id(this[0],n);a!==0?this.fields[n]=_.UTF8ToString(a):this.fields[n]=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[m>>>2]===0?null:re(m+v)}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 n=_.lengthBytesUTF8(t),s=_._malloc(n+1);_.stringToUTF8(t,s,n+1);let a=_._ts_language_symbol_for_name(this[0],s,n,r?1:0);return _._free(s),a||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]),V()}subtypes(t){return _._ts_language_subtypes_wasm(this[0],t),V()}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 s=await fetch(t);if(!s.ok){let o=await s.text();throw new Error(`Language.load failed with status ${s.status}.
|
|
2
2
|
|
|
3
|
-
${
|
|
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};
|
|
3
|
+
${o}`)}let a=s.clone();try{r=await WebAssembly.compileStreaming(s)}catch(o){console.error("wasm streaming compile failed:",o),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await a.arrayBuffer())}}let n=await _.loadWebAssemblyModule(r,{loadAsync:!0});return se(n,{sync:!1})}static loadSync(t){let r=_.loadWebAssemblyModule(t,{loadAsync:!1});return se(r,{sync:!0})}};function se(e,{sync:t}){let r=Object.keys(e),n=r.find(a=>Ae.test(a)&&!a.includes("external_scanner_"));if(!n)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 s=e[n]();return new S(f,s)}async function Te(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_=(e,t)=>{throw t},_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},readAsync=async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=async e=>{if(isFileURI(e))return new Promise((r,n)=>{var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=()=>{if(s.status==200||s.status==0&&s.response){r(s.response);return}n(s.status)},s.onerror=n,s.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=e=>e.startsWith("file://"),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)}function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||524288;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}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)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}function preMain(){}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}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}var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}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"}async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),n=await WebAssembly.instantiate(r,t);return n}catch(s){err(`failed to asynchronously prepare wasm: ${s}`),abort(s)}}async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var n=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(n,r);return s}catch(a){err(`wasm streaming compile failed: ${a}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function e(a,o){wasmExports=a.exports,wasmExports=relocateExports(wasmExports,1024);var l=getDylinkMetadata(o);l.neededDynlibs&&(dynamicLibraries=l.neededDynlibs.concat(dynamicLibraries));let d={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,d),updateGOT(d,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}function t(a){return e(a.instance,a.module)}var r=getWasmImports();if(Module.instantiateWasm)return new Promise((a,o)=>{Module.instantiateWasm(r,(l,d)=>{a(e(l,d))})});wasmBinaryFile??=findWasmBinary();var n=await instantiateAsync(wasmBinary,wasmBinaryFile,r),s=t(n);return s}class 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=e=>{for(;e.length>0;)e.shift()(Module)},onPostRuns=[],addOnPostRun=e=>onPostRuns.push(e),onPreRuns=[],addOnPreRun=e=>onPreRuns.push(e),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=(e,t,r,n)=>{var s=t+r;if(n)return s;for(;e[t]&&!(t>=s);)++t;return t},UTF8ArrayToString=(e,t=0,r,n)=>{var s=findStringEnd(e,t,r,n);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var a="";t<s;){var o=e[t++];if(!(o&128)){a+=String.fromCharCode(o);continue}var l=e[t++]&63;if((o&224)==192){a+=String.fromCharCode((o&31)<<6|l);continue}var d=e[t++]&63;if((o&240)==224?o=(o&15)<<12|l<<6|d:o=(o&7)<<18|l<<12|d<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var h=o-65536;a+=String.fromCharCode(55296|h>>10,56320|h&1023)}}return a},getDylinkMetadata=e=>{var t=0,r=0;function n(){return e[t++]}function s(){for(var y=0,T=1;;){var Y=e[t++];if(y+=(Y&127)*T,T*=128,!(Y&128))break}return y}function a(){var y=s();return t+=y,UTF8ArrayToString(e,t-y,y)}function o(){for(var y=s(),T=[];y--;)T.push(a());return T}function l(y,T){if(y)throw new Error(T)}if(e instanceof WebAssembly.Module){var d=WebAssembly.Module.customSections(e,"dylink.0");l(d.length===0,"need dylink section"),e=new Uint8Array(d[0]),r=e.length}else{var h=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),w=h[0]==1836278016;l(!w,"need to see wasm magic number"),l(e[8]!==0,"need the dylink section to be first"),t=9;var b=s();r=t+b;var B=a();l(B!=="dylink.0")}for(var g={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},le=1,de=2,ue=3,me=4,ce=5,ge=256,fe=3,he=1;t<r;){var R=n(),pe=s();if(R===le)g.memorySize=s(),g.memoryAlign=s(),g.tableSize=s(),g.tableAlign=s();else if(R===de)g.neededDynlibs=o();else if(R===ue)for(var D=s();D--;){var G=a(),j=s();j&ge&&g.tlsExports.add(G)}else if(R===me)for(var D=s();D--;){var Ce=a(),G=a(),j=s();(j&fe)==he&&g.weakImports.add(G)}else R===ce?g.runtimePaths=o():t+=pe}return g},newDSO=(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},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82176,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=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},isInternalSym=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__"),uleb128EncodeWithLen=e=>{let t=e.length;return[t%128|128,t>>7,...e]},wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),convertJsFunctionToWasm=(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),s=new WebAssembly.Instance(n,{e:{f:e}}),a=s.exports.f;return a},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:49,element:"anyfunc"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(a){if(!(a instanceof TypeError))throw a;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,s)}return functionsInTableMap.set(e,n),n},updateGOT=(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}`))}},relocateExports=(e,t,r)=>{var n={};for(var s in e){var a=e[s];typeof a=="object"&&(a=a.value),typeof a=="number"&&(a+=t),n[s]=a}return updateGOT(n,r),n},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCall=(e,t,r=[],n=!1)=>{var s=getWasmTableEntry(t),a=s(...r);function o(l){return l}return a},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),createInvokeFunction=e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;if(_setThrew(1,0),e[0]=="j")return 0n}},resolveGlobalSymbol=(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}},onPostCtors=[],addOnPostCtor=e=>onPostCtors.push(e),UTF8ToString=(e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"",loadWebAssemblyModule=(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}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]=(...s)=>(n||=resolveSymbol(t),n(...s))}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("__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)}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(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 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())},mergeLibSymbols=(e,t)=>{for(var[r,n]of Object.entries(e)){let s=o=>{isSymbolDefined(o)||(wasmImports[o]=n)};s(r);let a="__main_argc_argv";r=="main"&&s(a),r==a&&s("main")}},asyncLoad=async e=>{var t=await readAsync(e);return new Uint8Array(t)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):r&&Object.assign(r,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,n&&(LDSO.loadedLibsByHandle[n]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,n,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function a(){if(n){var d=HEAPU32[n+28>>2],h=HEAPU32[n+32>>2];if(d&&h){var w=HEAP8.slice(d,d+h);return t.loadAsync?Promise.resolve(w):w}}var b=locateFile(e);if(t.loadAsync)return asyncLoad(b);if(!readBinary)throw new Error(`${b}: file not found, and synchronous loading of external files is not available`);return readBinary(b)}function o(){return t.loadAsync?a().then(d=>loadWebAssemblyModule(d,t,e,r,n)):loadWebAssemblyModule(a(),t,e,r,n)}function l(d){s.global?mergeLibSymbols(d,e):r&&Object.assign(r,d),s.exports=d}return t.loadAsync?o().then(d=>(l(d),!0)):(l(o()),!0)}var reportUndefinedSymbols=()=>{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}`)}},runDependencies=0,dependenciesFulfilled=null,removeRunDependency=e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},addRunDependency=e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},loadDylibs=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")},noExitRuntime=!0,___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82176,___stack_low=16640,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82176),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=()=>{throw 1/0};__emscripten_throw_longjmp.sig="v";var timers={},handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},callUserCallback=e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(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.sig="iid";var getHeapMax=()=>2147483648,growMemory=e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},_emscripten_resize_heap=e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var s=t*(1+0/n);s=Math.min(s,e+100663296);var a=Math.min(r,alignMemory(Math.max(e,s),65536)),o=growMemory(a);if(o)return!0}return!1};_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}function _tree_sitter_parse_callback(e,t,r,n,s,a){let o=Module.currentParseCallback,l=typeof o=="string",d=l?o:o(r,{row:n,column:s}),h=l?r:0,w=typeof d=="string"?d.length-h:0;if(w<=0){HEAP32[a>>>2]=0;return}let b=w<t?w:t;if(b<w&&b>1){let g=d.charCodeAt(h+b-1);g>=55296&&g<=56319&&b--}let B=e>>>1;for(let g=0;g<b;g++)HEAPU16[B+g]=d.charCodeAt(h+g);HEAP32[a>>>2]=b}function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}var lengthBytesUTF8=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},stringToUTF8Array=(e,t,r,n)=>{if(!(n>0))return 0;for(var s=r,a=r+n-1,o=0;o<e.length;++o){var l=e.codePointAt(o);if(l<=127){if(r>=a)break;t[r++]=l}else if(l<=2047){if(r+1>=a)break;t[r++]=192|l>>6,t[r++]=128|l&63}else if(l<=65535){if(r+2>=a)break;t[r++]=224|l>>12,t[r++]=128|l>>6&63,t[r++]=128|l&63}else{if(r+3>=a)break;t[r++]=240|l>>18,t[r++]=128|l>>12&63,t[r++]=128|l>>6&63,t[r++]=128|l&63,o++}}return t[r]=0,r-s},stringToUTF8=(e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},AsciiToString=e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}};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_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_memcmp,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_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_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_current_node_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_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_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_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._memcmp=_memcmp=e.memcmp,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._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_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_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_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._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}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_iiij,invoke_vi,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(s){if(stackRestore(n),s!==s+0)throw s;_setThrew(1,0)}}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)}}function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}function invoke_viii(e,t,r,n){var s=stackSave();try{getWasmTableEntry(e)(t,r,n)}catch(a){if(stackRestore(s),a!==a+0)throw a;_setThrew(1,0)}}function invoke_iiij(e,t,r,n){var s=stackSave();try{return getWasmTableEntry(e)(t,r,n)}catch(a){if(stackRestore(s),a!==a+0)throw a;_setThrew(1,0)}}function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),s=n;e.forEach(o=>{HEAPU32[s>>2]=stringToUTF8OnStack(o),s+=4}),HEAPU32[s>>2]=0;try{var a=t(r,n);return exitJS(a,!0),a}catch(o){return handleException(o)}}}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()}}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}var Z=Te;var L=null;async function _e(e){if(L)return L;let{wasmModule:t,...r}=e??{};if(!t)return L??=await Z(r);let n=new Promise((s,a)=>{r.instantiateWasm=(o,l)=>(WebAssembly.instantiate(t,o).then(d=>{l(d,t)}).catch(a),{})});return L??=await Promise.race([Z(r),n])}function ae(){return!!L}var oe=4294967296,m,H,q;function Pe(e){let t=_._ts_language_abi_version(e[0]);if(t<q||t>H)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${H.toString(16)}.`)}var ie=I(e=>{_._ts_parser_delete(e[0]),_._free(e[1])}),K=class{0=0;1=0;logCallback=null;loggerEnabled=!1;language=null;lastParseOperations=0;static async init(t){X(await _e(t)),m=_._ts_init();let r=m>>>2;H=_.HEAP32[r],q=_.HEAP32[r+1]}constructor(){this.initialize(),ie?.register(this,[this[0],this[1]],this)}initialize(){if(!ae())throw new Error("cannot construct a Parser before calling `init()`");_._ts_parser_new_wasm();let t=m>>>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===S)r=t[0],Pe(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 n=Ie(r?.maxMemoryBytes),s=Se(r?.maxOperations);if(typeof t!="string"&&typeof t!="function")throw new Error("Argument must be a string or a function");let a=r?.progressCallback??null;_.currentParseCallback=t,_.currentProgressCallback=a,this.syncLogger(),this.lastParseOperations=0;try{let o=this.runParse(r,n,s);if(!o)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new C(f,o,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,n){if(r!==void 0&&!_.treeSitterSetMemoryLimit(r))return 0;try{let[s,a]=Re(t?.includedRanges);if(a&&!s)return 0;Ee(n,s,a,t?.progressCallback?1:0);try{return r===void 0?this.executeOrdinaryParse():this.executeLimitedParse()}finally{this.lastParseOperations=Ne()}}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]),x(!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 Ie(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}function Se(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0))throw new RangeError("maxOperations must be a positive safe integer");return e}function Re(e){if(!e?.length)return[0,0];let t=_._calloc(e.length,N);if(!t)return[0,e.length];try{let r=t;for(let n of e)te(r,n),r+=N;return[t,e.length]}catch(r){throw _._free(t),r}}function Ee(e,t,r,n){let s=m>>>2,a=_.HEAPU32;a[s]=e===void 0?0:e>>>0,a[s+1]=e===void 0?0:Math.floor(e/oe)>>>0,a[s+2]=t,a[s+3]=r,a[s+4]=n}function Ne(){let e=m>>>2,t=_.HEAPU32;return t[e]+t[e+1]*oe}function ke(){_.currentParseCallback=null,_.currentLogCallback=null,_.currentProgressCallback=null}export{H as LANGUAGE_VERSION,S as Language,q as MIN_COMPATIBLE_VERSION,O as Node,K as Parser,C as Tree,P as TreeCursor};
|
|
5
5
|
//# sourceMappingURL=web-tree-sitter.js.map
|