@willbooster/web-tree-sitter 19.1.1 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -20
- package/debug/web-tree-sitter.cjs +101 -452
- package/debug/web-tree-sitter.cjs.map +4 -4
- package/debug/web-tree-sitter.js +101 -450
- 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 -23
- package/package.json +6 -7
- package/web-tree-sitter.cjs +3 -3
- package/web-tree-sitter.cjs.map +4 -4
- package/web-tree-sitter.d.cts +2 -154
- package/web-tree-sitter.d.cts.map +3 -9
- package/web-tree-sitter.d.ts +2 -154
- package/web-tree-sitter.d.ts.map +3 -9
- 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 +24 -28
- package/web-tree-sitter.web.js +3 -3
- package/web-tree-sitter.web.js.map +4 -4
package/web-tree-sitter.d.cts
CHANGED
|
@@ -48,47 +48,6 @@
|
|
|
48
48
|
/** The memory imported by `web-tree-sitter.wasm`. */
|
|
49
49
|
wasmMemory?: WebAssembly.Memory;
|
|
50
50
|
}
|
|
51
|
-
export class Edit {
|
|
52
|
-
/** The start position of the change. */
|
|
53
|
-
startPosition: Point;
|
|
54
|
-
/** The end position of the change before the edit. */
|
|
55
|
-
oldEndPosition: Point;
|
|
56
|
-
/** The end position of the change after the edit. */
|
|
57
|
-
newEndPosition: Point;
|
|
58
|
-
/** The start index of the change. */
|
|
59
|
-
startIndex: number;
|
|
60
|
-
/** The end index of the change before the edit. */
|
|
61
|
-
oldEndIndex: number;
|
|
62
|
-
/** The end index of the change after the edit. */
|
|
63
|
-
newEndIndex: number;
|
|
64
|
-
constructor({ startIndex, oldEndIndex, newEndIndex, startPosition, oldEndPosition, newEndPosition, }: {
|
|
65
|
-
startIndex: number;
|
|
66
|
-
oldEndIndex: number;
|
|
67
|
-
newEndIndex: number;
|
|
68
|
-
startPosition: Point;
|
|
69
|
-
oldEndPosition: Point;
|
|
70
|
-
newEndPosition: Point;
|
|
71
|
-
});
|
|
72
|
-
/**
|
|
73
|
-
* Edit a point and index to keep it in-sync with source code that has been edited.
|
|
74
|
-
*
|
|
75
|
-
* This function updates a single point's byte offset and row/column position
|
|
76
|
-
* based on an edit operation. This is useful for editing points without
|
|
77
|
-
* requiring a tree or node instance.
|
|
78
|
-
*/
|
|
79
|
-
editPoint(point: Point, index: number): {
|
|
80
|
-
point: Point;
|
|
81
|
-
index: number;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Edit a range to keep it in-sync with source code that has been edited.
|
|
85
|
-
*
|
|
86
|
-
* This function updates a range's start and end positions based on an edit
|
|
87
|
-
* operation. This is useful for editing ranges without requiring a tree
|
|
88
|
-
* or node instance.
|
|
89
|
-
*/
|
|
90
|
-
editRange(range: Range): Range;
|
|
91
|
-
}
|
|
92
51
|
/**
|
|
93
52
|
* Options for parsing
|
|
94
53
|
*
|
|
@@ -203,10 +162,6 @@
|
|
|
203
162
|
*
|
|
204
163
|
* @param callback - The UTF8-encoded text to parse or a callback function.
|
|
205
164
|
*
|
|
206
|
-
* @param oldTree - A previous syntax tree parsed from the same document. If the text of the
|
|
207
|
-
* document has changed since `oldTree` was created, then you must edit `oldTree` to match
|
|
208
|
-
* the new text using {@link Tree#edit}.
|
|
209
|
-
*
|
|
210
165
|
* @param options - Options for parsing the text.
|
|
211
166
|
* This can be used to set the included ranges, or a progress callback.
|
|
212
167
|
*
|
|
@@ -215,7 +170,7 @@
|
|
|
215
170
|
* - The progress callback returned true.
|
|
216
171
|
* - The memory limit was reached or the operation limit was exceeded.
|
|
217
172
|
*/
|
|
218
|
-
parse(callback: string | ParseCallback,
|
|
173
|
+
parse(callback: string | ParseCallback, options?: ParseOptions): Tree | null;
|
|
219
174
|
/**
|
|
220
175
|
* Instruct the parser to start the next parse from the beginning.
|
|
221
176
|
*
|
|
@@ -315,27 +270,6 @@
|
|
|
315
270
|
* Get the subtype ids for a given supertype node id.
|
|
316
271
|
*/
|
|
317
272
|
subtypes(supertype: number): number[];
|
|
318
|
-
/**
|
|
319
|
-
* Get the next state id for a given state id and node type id.
|
|
320
|
-
*/
|
|
321
|
-
nextState(stateId: number, typeId: number): number;
|
|
322
|
-
/**
|
|
323
|
-
* Create a new lookahead iterator for this language and parse state.
|
|
324
|
-
*
|
|
325
|
-
* This returns `null` if state is invalid for this language.
|
|
326
|
-
*
|
|
327
|
-
* Iterating {@link LookaheadIterator} will yield valid symbols in the given
|
|
328
|
-
* parse state. A newly created iterator is not positioned on a symbol, so
|
|
329
|
-
* {@link LookaheadIterator#currentType} returns `null` until the first
|
|
330
|
-
* iteration step.
|
|
331
|
-
*
|
|
332
|
-
* Lookahead iterators can be useful for generating suggestions and improving
|
|
333
|
-
* syntax error diagnostics. To get symbols valid in an `ERROR` node, use the
|
|
334
|
-
* lookahead iterator on its first leaf node state. For `MISSING` nodes, a
|
|
335
|
-
* lookahead iterator created on the previous non-extra leaf node may be
|
|
336
|
-
* appropriate.
|
|
337
|
-
*/
|
|
338
|
-
lookaheadIterator(stateId: number): LookaheadIterator | null;
|
|
339
273
|
/**
|
|
340
274
|
* Load a language from a WebAssembly module.
|
|
341
275
|
* The module can be provided as a path to a file, a `URL` to a file, a
|
|
@@ -364,28 +298,8 @@
|
|
|
364
298
|
* forward by the given offset.
|
|
365
299
|
*/
|
|
366
300
|
rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node;
|
|
367
|
-
/**
|
|
368
|
-
* Edit the syntax tree to keep it in sync with source code that has been
|
|
369
|
-
* edited.
|
|
370
|
-
*
|
|
371
|
-
* You must describe the edit both in terms of byte offsets and in terms of
|
|
372
|
-
* row/column coordinates.
|
|
373
|
-
*/
|
|
374
|
-
edit(edit: Edit): void;
|
|
375
301
|
/** Create a new {@link TreeCursor} starting from the root of the tree. */
|
|
376
302
|
walk(): TreeCursor;
|
|
377
|
-
/**
|
|
378
|
-
* Compare this old edited syntax tree to a new syntax tree representing
|
|
379
|
-
* the same document, returning a sequence of ranges whose syntactic
|
|
380
|
-
* structure has changed.
|
|
381
|
-
*
|
|
382
|
-
* For this to work correctly, this syntax tree must have been edited such
|
|
383
|
-
* that its ranges match up to the new tree. Generally, you'll want to
|
|
384
|
-
* call this method right after calling one of the [`Parser::parse`]
|
|
385
|
-
* functions. Call it on the old tree that was passed to parse, and
|
|
386
|
-
* pass the new tree that was returned from `parse`.
|
|
387
|
-
*/
|
|
388
|
-
getChangedRanges(other: Tree): Range[];
|
|
389
303
|
/** Get the included ranges that were used to parse the syntax tree. */
|
|
390
304
|
getIncludedRanges(): Range[];
|
|
391
305
|
}
|
|
@@ -394,14 +308,7 @@
|
|
|
394
308
|
/**
|
|
395
309
|
* The numeric id for this node that is unique.
|
|
396
310
|
*
|
|
397
|
-
* Within a given syntax tree, no two nodes have the same id.
|
|
398
|
-
*
|
|
399
|
-
* * If a new tree is created based on an older tree, and a node from the old tree is reused in
|
|
400
|
-
* the process, then that node will have the same id in both trees.
|
|
401
|
-
*
|
|
402
|
-
* * A node not marked as having changes does not guarantee it was reused.
|
|
403
|
-
*
|
|
404
|
-
* * If a node is marked as having changed in the old tree, it will not be reused.
|
|
311
|
+
* Within a given syntax tree, no two nodes have the same id.
|
|
405
312
|
*/
|
|
406
313
|
id: number;
|
|
407
314
|
/** The byte index where this node starts. */
|
|
@@ -452,8 +359,6 @@
|
|
|
452
359
|
* certain kinds of syntax errors.
|
|
453
360
|
*/
|
|
454
361
|
get isMissing(): boolean;
|
|
455
|
-
/** Check if this node has been edited. */
|
|
456
|
-
get hasChanges(): boolean;
|
|
457
362
|
/**
|
|
458
363
|
* Check if this node represents a syntax error or contains any syntax
|
|
459
364
|
* errors anywhere within it.
|
|
@@ -465,10 +370,6 @@
|
|
|
465
370
|
get endPosition(): Point;
|
|
466
371
|
/** Get the string content of this node. */
|
|
467
372
|
get text(): string;
|
|
468
|
-
/** Get this node's parse state. */
|
|
469
|
-
get parseState(): number;
|
|
470
|
-
/** Get the parse state after this node. */
|
|
471
|
-
get nextParseState(): number;
|
|
472
373
|
/** Check if this node is equal to another node. */
|
|
473
374
|
equals(other: Node): boolean;
|
|
474
375
|
/**
|
|
@@ -611,16 +512,6 @@
|
|
|
611
512
|
* and the cursor cannot walk outside this node.
|
|
612
513
|
*/
|
|
613
514
|
walk(): TreeCursor;
|
|
614
|
-
/**
|
|
615
|
-
* Edit this node to keep it in-sync with source code that has been edited.
|
|
616
|
-
*
|
|
617
|
-
* This function is only rarely needed. When you edit a syntax tree with
|
|
618
|
-
* the {@link Tree#edit} method, all of the nodes that you retrieve from
|
|
619
|
-
* the tree afterward will already reflect the edit. You only need to
|
|
620
|
-
* use {@link Node#edit} when you have a specific {@link Node} instance that
|
|
621
|
-
* you want to keep and continue to use after an edit.
|
|
622
|
-
*/
|
|
623
|
-
edit(edit: Edit): void;
|
|
624
515
|
/** Get the S-expression representation of this node. */
|
|
625
516
|
toString(): string;
|
|
626
517
|
}
|
|
@@ -654,8 +545,6 @@
|
|
|
654
545
|
get nodeType(): string;
|
|
655
546
|
/** Get the type id of the cursor's current node. */
|
|
656
547
|
get nodeTypeId(): number;
|
|
657
|
-
/** Get the state id of the cursor's current node. */
|
|
658
|
-
get nodeStateId(): number;
|
|
659
548
|
/** Get the id of the cursor's current node. */
|
|
660
549
|
get nodeId(): number;
|
|
661
550
|
/**
|
|
@@ -770,47 +659,6 @@
|
|
|
770
659
|
*/
|
|
771
660
|
resetTo(cursor: TreeCursor): void;
|
|
772
661
|
}
|
|
773
|
-
export class LookaheadIterator implements Iterable<string> {
|
|
774
|
-
/**
|
|
775
|
-
* Get the current symbol of the lookahead iterator.
|
|
776
|
-
*
|
|
777
|
-
* Returns `null` if the iterator is not positioned on a symbol:
|
|
778
|
-
*
|
|
779
|
-
* - Before the first iteration step
|
|
780
|
-
* - After the iterator is exhausted
|
|
781
|
-
* - After a {@link reset} or {@link resetState} call
|
|
782
|
-
*/
|
|
783
|
-
get currentTypeId(): number | null;
|
|
784
|
-
/**
|
|
785
|
-
* Get the current symbol name of the lookahead iterator.
|
|
786
|
-
*
|
|
787
|
-
* Returns `null` if the iterator is not positioned on a symbol.
|
|
788
|
-
*/
|
|
789
|
-
get currentType(): string | null;
|
|
790
|
-
/** Delete the lookahead iterator, freeing its resources. */
|
|
791
|
-
delete(): void;
|
|
792
|
-
/**
|
|
793
|
-
* Reset the lookahead iterator.
|
|
794
|
-
*
|
|
795
|
-
* This returns `true` if the language was set successfully and `false`
|
|
796
|
-
* otherwise.
|
|
797
|
-
*/
|
|
798
|
-
reset(language: Language, stateId: number): boolean;
|
|
799
|
-
/**
|
|
800
|
-
* Reset the lookahead iterator to another state.
|
|
801
|
-
*
|
|
802
|
-
* This returns `true` if the iterator was reset to the given state and
|
|
803
|
-
* `false` otherwise.
|
|
804
|
-
*/
|
|
805
|
-
resetState(stateId: number): boolean;
|
|
806
|
-
/**
|
|
807
|
-
* Returns an iterator that iterates over the symbols of the lookahead iterator.
|
|
808
|
-
*
|
|
809
|
-
* The iterator will yield the current symbol name as a string for each step
|
|
810
|
-
* until there are no more symbols to iterate over.
|
|
811
|
-
*/
|
|
812
|
-
[Symbol.iterator](): Iterator<string>;
|
|
813
|
-
}
|
|
814
662
|
|
|
815
663
|
export {};
|
|
816
664
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"ProgressCallback",
|
|
9
9
|
"LogCallback",
|
|
10
10
|
"ParserInitOptions",
|
|
11
|
-
"Edit",
|
|
12
11
|
"ParseOptions",
|
|
13
12
|
"ParseState",
|
|
14
13
|
"LANGUAGE_VERSION",
|
|
@@ -18,19 +17,16 @@
|
|
|
18
17
|
"Language",
|
|
19
18
|
"Tree",
|
|
20
19
|
"Node",
|
|
21
|
-
"TreeCursor"
|
|
22
|
-
"LookaheadIterator"
|
|
20
|
+
"TreeCursor"
|
|
23
21
|
],
|
|
24
22
|
"sources": [
|
|
25
23
|
"src/constants.ts",
|
|
26
24
|
"src/bindings.ts",
|
|
27
|
-
"src/edit.ts",
|
|
28
25
|
"src/parser.ts",
|
|
29
26
|
"src/language.ts",
|
|
30
27
|
"src/tree.ts",
|
|
31
28
|
"src/node.ts",
|
|
32
|
-
"src/tree_cursor.ts"
|
|
33
|
-
"src/lookahead_iterator.ts"
|
|
29
|
+
"src/tree_cursor.ts"
|
|
34
30
|
],
|
|
35
31
|
"sourcesContent": [
|
|
36
32
|
null,
|
|
@@ -39,10 +35,8 @@
|
|
|
39
35
|
null,
|
|
40
36
|
null,
|
|
41
37
|
null,
|
|
42
|
-
null,
|
|
43
|
-
null,
|
|
44
38
|
null
|
|
45
39
|
],
|
|
46
|
-
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA
|
|
40
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAOhBC,sBAAsBA;;;;;cA0BpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCvHFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCsBRC,IAAIA;;;;;;;;;;;;;;;;;;;;cC9BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCEJC,UAAUA",
|
|
47
41
|
"ignoreList": []
|
|
48
42
|
}
|
package/web-tree-sitter.d.ts
CHANGED
|
@@ -48,47 +48,6 @@
|
|
|
48
48
|
/** The memory imported by `web-tree-sitter.wasm`. */
|
|
49
49
|
wasmMemory?: WebAssembly.Memory;
|
|
50
50
|
}
|
|
51
|
-
export class Edit {
|
|
52
|
-
/** The start position of the change. */
|
|
53
|
-
startPosition: Point;
|
|
54
|
-
/** The end position of the change before the edit. */
|
|
55
|
-
oldEndPosition: Point;
|
|
56
|
-
/** The end position of the change after the edit. */
|
|
57
|
-
newEndPosition: Point;
|
|
58
|
-
/** The start index of the change. */
|
|
59
|
-
startIndex: number;
|
|
60
|
-
/** The end index of the change before the edit. */
|
|
61
|
-
oldEndIndex: number;
|
|
62
|
-
/** The end index of the change after the edit. */
|
|
63
|
-
newEndIndex: number;
|
|
64
|
-
constructor({ startIndex, oldEndIndex, newEndIndex, startPosition, oldEndPosition, newEndPosition, }: {
|
|
65
|
-
startIndex: number;
|
|
66
|
-
oldEndIndex: number;
|
|
67
|
-
newEndIndex: number;
|
|
68
|
-
startPosition: Point;
|
|
69
|
-
oldEndPosition: Point;
|
|
70
|
-
newEndPosition: Point;
|
|
71
|
-
});
|
|
72
|
-
/**
|
|
73
|
-
* Edit a point and index to keep it in-sync with source code that has been edited.
|
|
74
|
-
*
|
|
75
|
-
* This function updates a single point's byte offset and row/column position
|
|
76
|
-
* based on an edit operation. This is useful for editing points without
|
|
77
|
-
* requiring a tree or node instance.
|
|
78
|
-
*/
|
|
79
|
-
editPoint(point: Point, index: number): {
|
|
80
|
-
point: Point;
|
|
81
|
-
index: number;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Edit a range to keep it in-sync with source code that has been edited.
|
|
85
|
-
*
|
|
86
|
-
* This function updates a range's start and end positions based on an edit
|
|
87
|
-
* operation. This is useful for editing ranges without requiring a tree
|
|
88
|
-
* or node instance.
|
|
89
|
-
*/
|
|
90
|
-
editRange(range: Range): Range;
|
|
91
|
-
}
|
|
92
51
|
/**
|
|
93
52
|
* Options for parsing
|
|
94
53
|
*
|
|
@@ -203,10 +162,6 @@
|
|
|
203
162
|
*
|
|
204
163
|
* @param callback - The UTF8-encoded text to parse or a callback function.
|
|
205
164
|
*
|
|
206
|
-
* @param oldTree - A previous syntax tree parsed from the same document. If the text of the
|
|
207
|
-
* document has changed since `oldTree` was created, then you must edit `oldTree` to match
|
|
208
|
-
* the new text using {@link Tree#edit}.
|
|
209
|
-
*
|
|
210
165
|
* @param options - Options for parsing the text.
|
|
211
166
|
* This can be used to set the included ranges, or a progress callback.
|
|
212
167
|
*
|
|
@@ -215,7 +170,7 @@
|
|
|
215
170
|
* - The progress callback returned true.
|
|
216
171
|
* - The memory limit was reached or the operation limit was exceeded.
|
|
217
172
|
*/
|
|
218
|
-
parse(callback: string | ParseCallback,
|
|
173
|
+
parse(callback: string | ParseCallback, options?: ParseOptions): Tree | null;
|
|
219
174
|
/**
|
|
220
175
|
* Instruct the parser to start the next parse from the beginning.
|
|
221
176
|
*
|
|
@@ -315,27 +270,6 @@
|
|
|
315
270
|
* Get the subtype ids for a given supertype node id.
|
|
316
271
|
*/
|
|
317
272
|
subtypes(supertype: number): number[];
|
|
318
|
-
/**
|
|
319
|
-
* Get the next state id for a given state id and node type id.
|
|
320
|
-
*/
|
|
321
|
-
nextState(stateId: number, typeId: number): number;
|
|
322
|
-
/**
|
|
323
|
-
* Create a new lookahead iterator for this language and parse state.
|
|
324
|
-
*
|
|
325
|
-
* This returns `null` if state is invalid for this language.
|
|
326
|
-
*
|
|
327
|
-
* Iterating {@link LookaheadIterator} will yield valid symbols in the given
|
|
328
|
-
* parse state. A newly created iterator is not positioned on a symbol, so
|
|
329
|
-
* {@link LookaheadIterator#currentType} returns `null` until the first
|
|
330
|
-
* iteration step.
|
|
331
|
-
*
|
|
332
|
-
* Lookahead iterators can be useful for generating suggestions and improving
|
|
333
|
-
* syntax error diagnostics. To get symbols valid in an `ERROR` node, use the
|
|
334
|
-
* lookahead iterator on its first leaf node state. For `MISSING` nodes, a
|
|
335
|
-
* lookahead iterator created on the previous non-extra leaf node may be
|
|
336
|
-
* appropriate.
|
|
337
|
-
*/
|
|
338
|
-
lookaheadIterator(stateId: number): LookaheadIterator | null;
|
|
339
273
|
/**
|
|
340
274
|
* Load a language from a WebAssembly module.
|
|
341
275
|
* The module can be provided as a path to a file, a `URL` to a file, a
|
|
@@ -364,28 +298,8 @@
|
|
|
364
298
|
* forward by the given offset.
|
|
365
299
|
*/
|
|
366
300
|
rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node;
|
|
367
|
-
/**
|
|
368
|
-
* Edit the syntax tree to keep it in sync with source code that has been
|
|
369
|
-
* edited.
|
|
370
|
-
*
|
|
371
|
-
* You must describe the edit both in terms of byte offsets and in terms of
|
|
372
|
-
* row/column coordinates.
|
|
373
|
-
*/
|
|
374
|
-
edit(edit: Edit): void;
|
|
375
301
|
/** Create a new {@link TreeCursor} starting from the root of the tree. */
|
|
376
302
|
walk(): TreeCursor;
|
|
377
|
-
/**
|
|
378
|
-
* Compare this old edited syntax tree to a new syntax tree representing
|
|
379
|
-
* the same document, returning a sequence of ranges whose syntactic
|
|
380
|
-
* structure has changed.
|
|
381
|
-
*
|
|
382
|
-
* For this to work correctly, this syntax tree must have been edited such
|
|
383
|
-
* that its ranges match up to the new tree. Generally, you'll want to
|
|
384
|
-
* call this method right after calling one of the [`Parser::parse`]
|
|
385
|
-
* functions. Call it on the old tree that was passed to parse, and
|
|
386
|
-
* pass the new tree that was returned from `parse`.
|
|
387
|
-
*/
|
|
388
|
-
getChangedRanges(other: Tree): Range[];
|
|
389
303
|
/** Get the included ranges that were used to parse the syntax tree. */
|
|
390
304
|
getIncludedRanges(): Range[];
|
|
391
305
|
}
|
|
@@ -394,14 +308,7 @@
|
|
|
394
308
|
/**
|
|
395
309
|
* The numeric id for this node that is unique.
|
|
396
310
|
*
|
|
397
|
-
* Within a given syntax tree, no two nodes have the same id.
|
|
398
|
-
*
|
|
399
|
-
* * If a new tree is created based on an older tree, and a node from the old tree is reused in
|
|
400
|
-
* the process, then that node will have the same id in both trees.
|
|
401
|
-
*
|
|
402
|
-
* * A node not marked as having changes does not guarantee it was reused.
|
|
403
|
-
*
|
|
404
|
-
* * If a node is marked as having changed in the old tree, it will not be reused.
|
|
311
|
+
* Within a given syntax tree, no two nodes have the same id.
|
|
405
312
|
*/
|
|
406
313
|
id: number;
|
|
407
314
|
/** The byte index where this node starts. */
|
|
@@ -452,8 +359,6 @@
|
|
|
452
359
|
* certain kinds of syntax errors.
|
|
453
360
|
*/
|
|
454
361
|
get isMissing(): boolean;
|
|
455
|
-
/** Check if this node has been edited. */
|
|
456
|
-
get hasChanges(): boolean;
|
|
457
362
|
/**
|
|
458
363
|
* Check if this node represents a syntax error or contains any syntax
|
|
459
364
|
* errors anywhere within it.
|
|
@@ -465,10 +370,6 @@
|
|
|
465
370
|
get endPosition(): Point;
|
|
466
371
|
/** Get the string content of this node. */
|
|
467
372
|
get text(): string;
|
|
468
|
-
/** Get this node's parse state. */
|
|
469
|
-
get parseState(): number;
|
|
470
|
-
/** Get the parse state after this node. */
|
|
471
|
-
get nextParseState(): number;
|
|
472
373
|
/** Check if this node is equal to another node. */
|
|
473
374
|
equals(other: Node): boolean;
|
|
474
375
|
/**
|
|
@@ -611,16 +512,6 @@
|
|
|
611
512
|
* and the cursor cannot walk outside this node.
|
|
612
513
|
*/
|
|
613
514
|
walk(): TreeCursor;
|
|
614
|
-
/**
|
|
615
|
-
* Edit this node to keep it in-sync with source code that has been edited.
|
|
616
|
-
*
|
|
617
|
-
* This function is only rarely needed. When you edit a syntax tree with
|
|
618
|
-
* the {@link Tree#edit} method, all of the nodes that you retrieve from
|
|
619
|
-
* the tree afterward will already reflect the edit. You only need to
|
|
620
|
-
* use {@link Node#edit} when you have a specific {@link Node} instance that
|
|
621
|
-
* you want to keep and continue to use after an edit.
|
|
622
|
-
*/
|
|
623
|
-
edit(edit: Edit): void;
|
|
624
515
|
/** Get the S-expression representation of this node. */
|
|
625
516
|
toString(): string;
|
|
626
517
|
}
|
|
@@ -654,8 +545,6 @@
|
|
|
654
545
|
get nodeType(): string;
|
|
655
546
|
/** Get the type id of the cursor's current node. */
|
|
656
547
|
get nodeTypeId(): number;
|
|
657
|
-
/** Get the state id of the cursor's current node. */
|
|
658
|
-
get nodeStateId(): number;
|
|
659
548
|
/** Get the id of the cursor's current node. */
|
|
660
549
|
get nodeId(): number;
|
|
661
550
|
/**
|
|
@@ -770,47 +659,6 @@
|
|
|
770
659
|
*/
|
|
771
660
|
resetTo(cursor: TreeCursor): void;
|
|
772
661
|
}
|
|
773
|
-
export class LookaheadIterator implements Iterable<string> {
|
|
774
|
-
/**
|
|
775
|
-
* Get the current symbol of the lookahead iterator.
|
|
776
|
-
*
|
|
777
|
-
* Returns `null` if the iterator is not positioned on a symbol:
|
|
778
|
-
*
|
|
779
|
-
* - Before the first iteration step
|
|
780
|
-
* - After the iterator is exhausted
|
|
781
|
-
* - After a {@link reset} or {@link resetState} call
|
|
782
|
-
*/
|
|
783
|
-
get currentTypeId(): number | null;
|
|
784
|
-
/**
|
|
785
|
-
* Get the current symbol name of the lookahead iterator.
|
|
786
|
-
*
|
|
787
|
-
* Returns `null` if the iterator is not positioned on a symbol.
|
|
788
|
-
*/
|
|
789
|
-
get currentType(): string | null;
|
|
790
|
-
/** Delete the lookahead iterator, freeing its resources. */
|
|
791
|
-
delete(): void;
|
|
792
|
-
/**
|
|
793
|
-
* Reset the lookahead iterator.
|
|
794
|
-
*
|
|
795
|
-
* This returns `true` if the language was set successfully and `false`
|
|
796
|
-
* otherwise.
|
|
797
|
-
*/
|
|
798
|
-
reset(language: Language, stateId: number): boolean;
|
|
799
|
-
/**
|
|
800
|
-
* Reset the lookahead iterator to another state.
|
|
801
|
-
*
|
|
802
|
-
* This returns `true` if the iterator was reset to the given state and
|
|
803
|
-
* `false` otherwise.
|
|
804
|
-
*/
|
|
805
|
-
resetState(stateId: number): boolean;
|
|
806
|
-
/**
|
|
807
|
-
* Returns an iterator that iterates over the symbols of the lookahead iterator.
|
|
808
|
-
*
|
|
809
|
-
* The iterator will yield the current symbol name as a string for each step
|
|
810
|
-
* until there are no more symbols to iterate over.
|
|
811
|
-
*/
|
|
812
|
-
[Symbol.iterator](): Iterator<string>;
|
|
813
|
-
}
|
|
814
662
|
|
|
815
663
|
export {};
|
|
816
664
|
|
package/web-tree-sitter.d.ts.map
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"ProgressCallback",
|
|
9
9
|
"LogCallback",
|
|
10
10
|
"ParserInitOptions",
|
|
11
|
-
"Edit",
|
|
12
11
|
"ParseOptions",
|
|
13
12
|
"ParseState",
|
|
14
13
|
"LANGUAGE_VERSION",
|
|
@@ -18,19 +17,16 @@
|
|
|
18
17
|
"Language",
|
|
19
18
|
"Tree",
|
|
20
19
|
"Node",
|
|
21
|
-
"TreeCursor"
|
|
22
|
-
"LookaheadIterator"
|
|
20
|
+
"TreeCursor"
|
|
23
21
|
],
|
|
24
22
|
"sources": [
|
|
25
23
|
"src/constants.ts",
|
|
26
24
|
"src/bindings.ts",
|
|
27
|
-
"src/edit.ts",
|
|
28
25
|
"src/parser.ts",
|
|
29
26
|
"src/language.ts",
|
|
30
27
|
"src/tree.ts",
|
|
31
28
|
"src/node.ts",
|
|
32
|
-
"src/tree_cursor.ts"
|
|
33
|
-
"src/lookahead_iterator.ts"
|
|
29
|
+
"src/tree_cursor.ts"
|
|
34
30
|
],
|
|
35
31
|
"sourcesContent": [
|
|
36
32
|
null,
|
|
@@ -39,10 +35,8 @@
|
|
|
39
35
|
null,
|
|
40
36
|
null,
|
|
41
37
|
null,
|
|
42
|
-
null,
|
|
43
|
-
null,
|
|
44
38
|
null
|
|
45
39
|
],
|
|
46
|
-
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA
|
|
40
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAgCVC,aAAaA;;;;aAMbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBC3DNC,iBAAiBA;;;;;;;;;;;;;;;;;;;;kBCajBC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDZC,UAAUA;;;;;;;;;;;;;;YAuBhBC,gBAAgBA;;;;;;YAOhBC,sBAAsBA;;;;;cA0BpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCvHFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCsBRC,IAAIA;;;;;;;;;;;;;;;;;;;;cC9BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCEJC,UAAUA",
|
|
47
41
|
"ignoreList": []
|
|
48
42
|
}
|