@vscode/tree-sitter-wasm 0.0.5 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/cgmanifest.json +1 -1
- package/package.json +2 -2
- package/wasm/tree-sitter.js +3983 -3197
- package/wasm/tree-sitter.wasm +0 -0
- package/wasm/web-tree-sitter.d.ts +1027 -0
- package/wasm/tree-sitter-web.d.ts +0 -241
@@ -1,241 +0,0 @@
|
|
1
|
-
|
2
|
-
export class Parser {
|
3
|
-
/**
|
4
|
-
*
|
5
|
-
* @param moduleOptions Optional emscripten module-object, see https://emscripten.org/docs/api_reference/module.html
|
6
|
-
*/
|
7
|
-
static init(moduleOptions?: object): Promise<void>;
|
8
|
-
delete(): void;
|
9
|
-
parse(input: string | Parser.Input, oldTree?: Parser.Tree, options?: Parser.Options): Parser.Tree;
|
10
|
-
getIncludedRanges(): Parser.Range[];
|
11
|
-
getTimeoutMicros(): number;
|
12
|
-
setTimeoutMicros(timeout: number): void;
|
13
|
-
reset(): void;
|
14
|
-
getLanguage(): Parser.Language;
|
15
|
-
setLanguage(language?: Parser.Language | null): void;
|
16
|
-
getLogger(): Parser.Logger;
|
17
|
-
setLogger(logFunc?: Parser.Logger | false | null): void;
|
18
|
-
}
|
19
|
-
|
20
|
-
export namespace Parser {
|
21
|
-
export type Options = {
|
22
|
-
includedRanges?: Range[];
|
23
|
-
};
|
24
|
-
|
25
|
-
export type Point = {
|
26
|
-
row: number;
|
27
|
-
column: number;
|
28
|
-
};
|
29
|
-
|
30
|
-
export type Range = {
|
31
|
-
startIndex: number,
|
32
|
-
endIndex: number,
|
33
|
-
startPosition: Point,
|
34
|
-
endPosition: Point
|
35
|
-
};
|
36
|
-
|
37
|
-
export type Edit = {
|
38
|
-
startIndex: number;
|
39
|
-
oldEndIndex: number;
|
40
|
-
newEndIndex: number;
|
41
|
-
startPosition: Point;
|
42
|
-
oldEndPosition: Point;
|
43
|
-
newEndPosition: Point;
|
44
|
-
};
|
45
|
-
|
46
|
-
export type Logger = (
|
47
|
-
message: string,
|
48
|
-
params: { [param: string]: string },
|
49
|
-
type: "parse" | "lex"
|
50
|
-
) => void;
|
51
|
-
|
52
|
-
export interface Input {
|
53
|
-
(index: number, position?: Point): string | null;
|
54
|
-
}
|
55
|
-
|
56
|
-
export interface SyntaxNode {
|
57
|
-
tree: Tree;
|
58
|
-
id: number;
|
59
|
-
typeId: number;
|
60
|
-
grammarId: number;
|
61
|
-
type: string;
|
62
|
-
grammarType: string;
|
63
|
-
isNamed: boolean;
|
64
|
-
isMissing: boolean;
|
65
|
-
isExtra: boolean;
|
66
|
-
hasChanges: boolean;
|
67
|
-
hasError: boolean;
|
68
|
-
isError: boolean;
|
69
|
-
text: string;
|
70
|
-
parseState: number;
|
71
|
-
nextParseState: number;
|
72
|
-
startPosition: Point;
|
73
|
-
endPosition: Point;
|
74
|
-
startIndex: number;
|
75
|
-
endIndex: number;
|
76
|
-
parent: SyntaxNode | null;
|
77
|
-
children: Array<SyntaxNode>;
|
78
|
-
namedChildren: Array<SyntaxNode>;
|
79
|
-
childCount: number;
|
80
|
-
namedChildCount: number;
|
81
|
-
firstChild: SyntaxNode | null;
|
82
|
-
firstNamedChild: SyntaxNode | null;
|
83
|
-
lastChild: SyntaxNode | null;
|
84
|
-
lastNamedChild: SyntaxNode | null;
|
85
|
-
nextSibling: SyntaxNode | null;
|
86
|
-
nextNamedSibling: SyntaxNode | null;
|
87
|
-
previousSibling: SyntaxNode | null;
|
88
|
-
previousNamedSibling: SyntaxNode | null;
|
89
|
-
descendantCount: number;
|
90
|
-
|
91
|
-
equals(other: SyntaxNode): boolean;
|
92
|
-
toString(): string;
|
93
|
-
child(index: number): SyntaxNode | null;
|
94
|
-
namedChild(index: number): SyntaxNode | null;
|
95
|
-
childForFieldName(fieldName: string): SyntaxNode | null;
|
96
|
-
childForFieldId(fieldId: number): SyntaxNode | null;
|
97
|
-
fieldNameForChild(childIndex: number): string | null;
|
98
|
-
childrenForFieldName(fieldName: string): Array<SyntaxNode>;
|
99
|
-
childrenForFieldId(fieldId: number): Array<SyntaxNode>;
|
100
|
-
firstChildForIndex(index: number): SyntaxNode | null;
|
101
|
-
firstNamedChildForIndex(index: number): SyntaxNode | null;
|
102
|
-
|
103
|
-
descendantForIndex(index: number): SyntaxNode;
|
104
|
-
descendantForIndex(startIndex: number, endIndex: number): SyntaxNode;
|
105
|
-
namedDescendantForIndex(index: number): SyntaxNode;
|
106
|
-
namedDescendantForIndex(startIndex: number, endIndex: number): SyntaxNode;
|
107
|
-
descendantForPosition(position: Point): SyntaxNode;
|
108
|
-
descendantForPosition(startPosition: Point, endPosition: Point): SyntaxNode;
|
109
|
-
namedDescendantForPosition(position: Point): SyntaxNode;
|
110
|
-
namedDescendantForPosition(startPosition: Point, endPosition: Point): SyntaxNode;
|
111
|
-
descendantsOfType(types: String | Array<String>, startPosition?: Point, endPosition?: Point): Array<SyntaxNode>;
|
112
|
-
|
113
|
-
walk(): TreeCursor;
|
114
|
-
}
|
115
|
-
|
116
|
-
export interface TreeCursor {
|
117
|
-
nodeType: string;
|
118
|
-
nodeTypeId: number;
|
119
|
-
nodeStateId: number;
|
120
|
-
nodeText: string;
|
121
|
-
nodeId: number;
|
122
|
-
nodeIsNamed: boolean;
|
123
|
-
nodeIsMissing: boolean;
|
124
|
-
startPosition: Point;
|
125
|
-
endPosition: Point;
|
126
|
-
startIndex: number;
|
127
|
-
endIndex: number;
|
128
|
-
readonly currentNode: SyntaxNode;
|
129
|
-
readonly currentFieldName: string;
|
130
|
-
readonly currentFieldId: number;
|
131
|
-
readonly currentDepth: number;
|
132
|
-
readonly currentDescendantIndex: number;
|
133
|
-
|
134
|
-
reset(node: SyntaxNode): void;
|
135
|
-
resetTo(cursor: TreeCursor): void;
|
136
|
-
delete(): void;
|
137
|
-
gotoParent(): boolean;
|
138
|
-
gotoFirstChild(): boolean;
|
139
|
-
gotoLastChild(): boolean;
|
140
|
-
gotoFirstChildForIndex(goalIndex: number): boolean;
|
141
|
-
gotoFirstChildForPosition(goalPosition: Point): boolean;
|
142
|
-
gotoNextSibling(): boolean;
|
143
|
-
gotoPreviousSibling(): boolean;
|
144
|
-
gotoDescendant(goalDescendantIndex: number): void;
|
145
|
-
}
|
146
|
-
|
147
|
-
export interface Tree {
|
148
|
-
readonly rootNode: SyntaxNode;
|
149
|
-
|
150
|
-
rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): SyntaxNode;
|
151
|
-
copy(): Tree;
|
152
|
-
delete(): void;
|
153
|
-
edit(edit: Edit): Tree;
|
154
|
-
walk(): TreeCursor;
|
155
|
-
getChangedRanges(other: Tree): Range[];
|
156
|
-
getIncludedRanges(): Range[];
|
157
|
-
getEditedRange(other: Tree): Range;
|
158
|
-
getLanguage(): Language;
|
159
|
-
}
|
160
|
-
|
161
|
-
export interface QueryCapture {
|
162
|
-
name: string;
|
163
|
-
text?: string;
|
164
|
-
node: SyntaxNode;
|
165
|
-
setProperties?: { [prop: string]: string | null };
|
166
|
-
assertedProperties?: { [prop: string]: string | null };
|
167
|
-
refutedProperties?: { [prop: string]: string | null };
|
168
|
-
}
|
169
|
-
|
170
|
-
export interface QueryMatch {
|
171
|
-
pattern: number;
|
172
|
-
captures: QueryCapture[];
|
173
|
-
}
|
174
|
-
|
175
|
-
export type QueryOptions = {
|
176
|
-
startPosition?: Point;
|
177
|
-
endPosition?: Point;
|
178
|
-
startIndex?: number;
|
179
|
-
endIndex?: number;
|
180
|
-
matchLimit?: number;
|
181
|
-
maxStartDepth?: number;
|
182
|
-
};
|
183
|
-
|
184
|
-
export interface PredicateResult {
|
185
|
-
operator: string;
|
186
|
-
operands: { name: string; type: string }[];
|
187
|
-
}
|
188
|
-
|
189
|
-
export class Query {
|
190
|
-
captureNames: string[];
|
191
|
-
readonly predicates: { [name: string]: Function }[];
|
192
|
-
readonly setProperties: any[];
|
193
|
-
readonly assertedProperties: any[];
|
194
|
-
readonly refutedProperties: any[];
|
195
|
-
readonly matchLimit: number;
|
196
|
-
|
197
|
-
delete(): void;
|
198
|
-
captures(node: SyntaxNode, options?: QueryOptions): QueryCapture[];
|
199
|
-
matches(node: SyntaxNode, options?: QueryOptions): QueryMatch[];
|
200
|
-
predicatesForPattern(patternIndex: number): PredicateResult[];
|
201
|
-
disableCapture(captureName: string): void;
|
202
|
-
disablePattern(patternIndex: number): void;
|
203
|
-
isPatternGuaranteedAtStep(byteOffset: number): boolean;
|
204
|
-
isPatternRooted(patternIndex: number): boolean;
|
205
|
-
isPatternNonLocal(patternIndex: number): boolean;
|
206
|
-
startIndexForPattern(patternIndex: number): number;
|
207
|
-
didExceedMatchLimit(): boolean;
|
208
|
-
}
|
209
|
-
|
210
|
-
class Language {
|
211
|
-
static load(input: string | Uint8Array): Promise<Language>;
|
212
|
-
|
213
|
-
readonly version: number;
|
214
|
-
readonly fieldCount: number;
|
215
|
-
readonly stateCount: number;
|
216
|
-
readonly nodeTypeCount: number;
|
217
|
-
|
218
|
-
fieldNameForId(fieldId: number): string | null;
|
219
|
-
fieldIdForName(fieldName: string): number | null;
|
220
|
-
idForNodeType(type: string, named: boolean): number;
|
221
|
-
nodeTypeForId(typeId: number): string | null;
|
222
|
-
nodeTypeIsNamed(typeId: number): boolean;
|
223
|
-
nodeTypeIsVisible(typeId: number): boolean;
|
224
|
-
nextState(stateId: number, typeId: number): number;
|
225
|
-
query(source: string): Query;
|
226
|
-
lookaheadIterator(stateId: number): LookaheadIterable | null;
|
227
|
-
}
|
228
|
-
|
229
|
-
export class LookaheadIterable {
|
230
|
-
readonly language: Language;
|
231
|
-
readonly currentTypeId: number;
|
232
|
-
readonly currentType: string;
|
233
|
-
|
234
|
-
delete(): void;
|
235
|
-
reset(language: Language, stateId: number): boolean;
|
236
|
-
resetState(stateId: number): boolean;
|
237
|
-
[Symbol.iterator](): Iterator<string>;
|
238
|
-
}
|
239
|
-
}
|
240
|
-
|
241
|
-
|