@spyglassmc/mcdoc 0.3.8 → 0.3.9
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/lib/binder/index.js +108 -192
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -4
- package/lib/node/index.d.ts +5 -0
- package/lib/node/index.js +76 -131
- package/lib/parser/index.js +97 -217
- package/lib/runtime/attribute/builtin.d.ts +3 -0
- package/lib/runtime/attribute/builtin.js +130 -0
- package/lib/runtime/attribute/index.d.ts +22 -0
- package/lib/runtime/attribute/index.js +22 -0
- package/lib/runtime/attribute/validator.d.ts +16 -0
- package/lib/runtime/attribute/validator.js +85 -0
- package/lib/runtime/checker/context.d.ts +34 -0
- package/lib/runtime/checker/context.js +17 -0
- package/lib/runtime/checker/error.d.ts +70 -0
- package/lib/runtime/checker/error.js +352 -0
- package/lib/runtime/checker/index.d.ts +80 -0
- package/lib/runtime/checker/index.js +914 -0
- package/lib/runtime/completer/index.d.ts +20 -0
- package/lib/runtime/completer/index.js +123 -0
- package/lib/runtime/index.d.ts +5 -0
- package/lib/runtime/index.js +5 -0
- package/lib/type/index.d.ts +65 -82
- package/lib/type/index.js +341 -407
- package/lib/uri_processors.js +2 -8
- package/package.json +3 -3
package/lib/node/index.js
CHANGED
|
@@ -9,13 +9,13 @@ export var ModuleNode;
|
|
|
9
9
|
export var TopLevelNode;
|
|
10
10
|
(function (TopLevelNode) {
|
|
11
11
|
function is(node) {
|
|
12
|
-
return (CommentNode.is(node)
|
|
13
|
-
DispatchStatementNode.is(node)
|
|
14
|
-
EnumNode.is(node)
|
|
15
|
-
InjectionNode.is(node)
|
|
16
|
-
StructNode.is(node)
|
|
17
|
-
TypeAliasNode.is(node)
|
|
18
|
-
UseStatementNode.is(node));
|
|
12
|
+
return (CommentNode.is(node)
|
|
13
|
+
|| DispatchStatementNode.is(node)
|
|
14
|
+
|| EnumNode.is(node)
|
|
15
|
+
|| InjectionNode.is(node)
|
|
16
|
+
|| StructNode.is(node)
|
|
17
|
+
|| TypeAliasNode.is(node)
|
|
18
|
+
|| UseStatementNode.is(node));
|
|
19
19
|
}
|
|
20
20
|
TopLevelNode.is = is;
|
|
21
21
|
})(TopLevelNode || (TopLevelNode = {}));
|
|
@@ -32,8 +32,7 @@ export var DispatchStatementNode;
|
|
|
32
32
|
}
|
|
33
33
|
DispatchStatementNode.destruct = destruct;
|
|
34
34
|
function is(node) {
|
|
35
|
-
return (node?.type ===
|
|
36
|
-
'mcdoc:dispatch_statement');
|
|
35
|
+
return (node?.type === 'mcdoc:dispatch_statement');
|
|
37
36
|
}
|
|
38
37
|
DispatchStatementNode.is = is;
|
|
39
38
|
})(DispatchStatementNode || (DispatchStatementNode = {}));
|
|
@@ -47,9 +46,7 @@ export var LiteralNode;
|
|
|
47
46
|
export var IndexBodyNode;
|
|
48
47
|
(function (IndexBodyNode) {
|
|
49
48
|
function destruct(node) {
|
|
50
|
-
return {
|
|
51
|
-
parallelIndices: node.children.filter(IndexNode.is),
|
|
52
|
-
};
|
|
49
|
+
return { parallelIndices: node.children.filter(IndexNode.is) };
|
|
53
50
|
}
|
|
54
51
|
IndexBodyNode.destruct = destruct;
|
|
55
52
|
function is(node) {
|
|
@@ -67,10 +64,10 @@ export var IndexNode;
|
|
|
67
64
|
export var StaticIndexNode;
|
|
68
65
|
(function (StaticIndexNode) {
|
|
69
66
|
function is(node) {
|
|
70
|
-
return (LiteralNode.is(node)
|
|
71
|
-
IdentifierNode.is(node)
|
|
72
|
-
StringNode.is(node)
|
|
73
|
-
ResourceLocationNode.is(node));
|
|
67
|
+
return (LiteralNode.is(node)
|
|
68
|
+
|| IdentifierNode.is(node)
|
|
69
|
+
|| StringNode.is(node)
|
|
70
|
+
|| ResourceLocationNode.is(node));
|
|
74
71
|
}
|
|
75
72
|
StaticIndexNode.is = is;
|
|
76
73
|
})(StaticIndexNode || (StaticIndexNode = {}));
|
|
@@ -84,9 +81,7 @@ export var IdentifierNode;
|
|
|
84
81
|
export var DynamicIndexNode;
|
|
85
82
|
(function (DynamicIndexNode) {
|
|
86
83
|
function destruct(node) {
|
|
87
|
-
return {
|
|
88
|
-
keys: node.children.filter(AccessorKeyNode.is),
|
|
89
|
-
};
|
|
84
|
+
return { keys: node.children.filter(AccessorKeyNode.is) };
|
|
90
85
|
}
|
|
91
86
|
DynamicIndexNode.destruct = destruct;
|
|
92
87
|
function is(node) {
|
|
@@ -104,19 +99,19 @@ export var AccessorKeyNode;
|
|
|
104
99
|
export var TypeNode;
|
|
105
100
|
(function (TypeNode) {
|
|
106
101
|
function is(node) {
|
|
107
|
-
return (AnyTypeNode.is(node)
|
|
108
|
-
BooleanTypeNode.is(node)
|
|
109
|
-
StringTypeNode.is(node)
|
|
110
|
-
LiteralTypeNode.is(node)
|
|
111
|
-
NumericTypeNode.is(node)
|
|
112
|
-
PrimitiveArrayTypeNode.is(node)
|
|
113
|
-
ListTypeNode.is(node)
|
|
114
|
-
TupleTypeNode.is(node)
|
|
115
|
-
EnumNode.is(node)
|
|
116
|
-
StructNode.is(node)
|
|
117
|
-
ReferenceTypeNode.is(node)
|
|
118
|
-
DispatcherTypeNode.is(node)
|
|
119
|
-
UnionTypeNode.is(node));
|
|
102
|
+
return (AnyTypeNode.is(node)
|
|
103
|
+
|| BooleanTypeNode.is(node)
|
|
104
|
+
|| StringTypeNode.is(node)
|
|
105
|
+
|| LiteralTypeNode.is(node)
|
|
106
|
+
|| NumericTypeNode.is(node)
|
|
107
|
+
|| PrimitiveArrayTypeNode.is(node)
|
|
108
|
+
|| ListTypeNode.is(node)
|
|
109
|
+
|| TupleTypeNode.is(node)
|
|
110
|
+
|| EnumNode.is(node)
|
|
111
|
+
|| StructNode.is(node)
|
|
112
|
+
|| ReferenceTypeNode.is(node)
|
|
113
|
+
|| DispatcherTypeNode.is(node)
|
|
114
|
+
|| UnionTypeNode.is(node));
|
|
120
115
|
}
|
|
121
116
|
TypeNode.is = is;
|
|
122
117
|
})(TypeNode || (TypeNode = {}));
|
|
@@ -161,31 +156,25 @@ export var AttributeTreeNode;
|
|
|
161
156
|
}
|
|
162
157
|
AttributeTreeNode.destruct = destruct;
|
|
163
158
|
function is(node) {
|
|
164
|
-
return (node?.type ===
|
|
165
|
-
'mcdoc:attribute/tree');
|
|
159
|
+
return (node?.type === 'mcdoc:attribute/tree');
|
|
166
160
|
}
|
|
167
161
|
AttributeTreeNode.is = is;
|
|
168
162
|
})(AttributeTreeNode || (AttributeTreeNode = {}));
|
|
169
163
|
export var AttributeTreePosValuesNode;
|
|
170
164
|
(function (AttributeTreePosValuesNode) {
|
|
171
165
|
function destruct(node) {
|
|
172
|
-
return {
|
|
173
|
-
values: node.children.filter(AttributeValueNode.is),
|
|
174
|
-
};
|
|
166
|
+
return { values: node.children.filter(AttributeValueNode.is) };
|
|
175
167
|
}
|
|
176
168
|
AttributeTreePosValuesNode.destruct = destruct;
|
|
177
169
|
function is(node) {
|
|
178
|
-
return (node?.type ===
|
|
179
|
-
'mcdoc:attribute/tree/pos');
|
|
170
|
+
return (node?.type === 'mcdoc:attribute/tree/pos');
|
|
180
171
|
}
|
|
181
172
|
AttributeTreePosValuesNode.is = is;
|
|
182
173
|
})(AttributeTreePosValuesNode || (AttributeTreePosValuesNode = {}));
|
|
183
174
|
export var AttributeTreeNamedValuesNode;
|
|
184
175
|
(function (AttributeTreeNamedValuesNode) {
|
|
185
176
|
function destruct(node) {
|
|
186
|
-
const ans = {
|
|
187
|
-
values: [],
|
|
188
|
-
};
|
|
177
|
+
const ans = { values: [] };
|
|
189
178
|
let key;
|
|
190
179
|
for (const child of node.children) {
|
|
191
180
|
if (CommentNode.is(child)) {
|
|
@@ -203,17 +192,15 @@ export var AttributeTreeNamedValuesNode;
|
|
|
203
192
|
}
|
|
204
193
|
AttributeTreeNamedValuesNode.destruct = destruct;
|
|
205
194
|
function is(node) {
|
|
206
|
-
return (node?.type
|
|
207
|
-
'mcdoc:attribute/tree/named');
|
|
195
|
+
return (node?.type
|
|
196
|
+
=== 'mcdoc:attribute/tree/named');
|
|
208
197
|
}
|
|
209
198
|
AttributeTreeNamedValuesNode.is = is;
|
|
210
199
|
})(AttributeTreeNamedValuesNode || (AttributeTreeNamedValuesNode = {}));
|
|
211
200
|
export var TypeArgBlockNode;
|
|
212
201
|
(function (TypeArgBlockNode) {
|
|
213
202
|
function destruct(node) {
|
|
214
|
-
return {
|
|
215
|
-
args: node.children.filter(TypeNode.is),
|
|
216
|
-
};
|
|
203
|
+
return { args: node.children.filter(TypeNode.is) };
|
|
217
204
|
}
|
|
218
205
|
TypeArgBlockNode.destruct = destruct;
|
|
219
206
|
function is(node) {
|
|
@@ -231,8 +218,7 @@ export var AnyTypeNode;
|
|
|
231
218
|
export var BooleanTypeNode;
|
|
232
219
|
(function (BooleanTypeNode) {
|
|
233
220
|
function is(node) {
|
|
234
|
-
return node?.type ===
|
|
235
|
-
'mcdoc:type/boolean';
|
|
221
|
+
return node?.type === 'mcdoc:type/boolean';
|
|
236
222
|
}
|
|
237
223
|
BooleanTypeNode.is = is;
|
|
238
224
|
})(BooleanTypeNode || (BooleanTypeNode = {}));
|
|
@@ -250,14 +236,11 @@ export var IntRangeNode;
|
|
|
250
236
|
export var LiteralTypeNode;
|
|
251
237
|
(function (LiteralTypeNode) {
|
|
252
238
|
function destruct(node) {
|
|
253
|
-
return {
|
|
254
|
-
value: node.children.find(LiteralTypeValueNode.is),
|
|
255
|
-
};
|
|
239
|
+
return { value: node.children.find(LiteralTypeValueNode.is) };
|
|
256
240
|
}
|
|
257
241
|
LiteralTypeNode.destruct = destruct;
|
|
258
242
|
function is(node) {
|
|
259
|
-
return node?.type ===
|
|
260
|
-
'mcdoc:type/literal';
|
|
243
|
+
return node?.type === 'mcdoc:type/literal';
|
|
261
244
|
}
|
|
262
245
|
LiteralTypeNode.is = is;
|
|
263
246
|
})(LiteralTypeNode || (LiteralTypeNode = {}));
|
|
@@ -272,15 +255,13 @@ export var TypedNumberNode;
|
|
|
272
255
|
(function (TypedNumberNode) {
|
|
273
256
|
function destruct(node) {
|
|
274
257
|
return {
|
|
275
|
-
value: node.children.find(FloatNode.is) ??
|
|
276
|
-
node.children.find(IntegerNode.is),
|
|
258
|
+
value: node.children.find(FloatNode.is) ?? node.children.find(IntegerNode.is),
|
|
277
259
|
suffix: node.children.find(LiteralNode.is),
|
|
278
260
|
};
|
|
279
261
|
}
|
|
280
262
|
TypedNumberNode.destruct = destruct;
|
|
281
263
|
function is(node) {
|
|
282
|
-
return node?.type ===
|
|
283
|
-
'mcdoc:typed_number';
|
|
264
|
+
return node?.type === 'mcdoc:typed_number';
|
|
284
265
|
}
|
|
285
266
|
TypedNumberNode.is = is;
|
|
286
267
|
})(TypedNumberNode || (TypedNumberNode = {}));
|
|
@@ -289,18 +270,27 @@ export var NumericTypeNode;
|
|
|
289
270
|
function destruct(node) {
|
|
290
271
|
return {
|
|
291
272
|
numericKind: node.children.find(LiteralNode.is),
|
|
292
|
-
valueRange: node.children.find(FloatRangeNode.is) ||
|
|
293
|
-
node.children.find(IntRangeNode.is),
|
|
273
|
+
valueRange: node.children.find(FloatRangeNode.is) || node.children.find(IntRangeNode.is),
|
|
294
274
|
};
|
|
295
275
|
}
|
|
296
276
|
NumericTypeNode.destruct = destruct;
|
|
297
277
|
function is(node) {
|
|
298
|
-
return (node?.type ===
|
|
299
|
-
'mcdoc:type/numeric_type');
|
|
278
|
+
return (node?.type === 'mcdoc:type/numeric_type');
|
|
300
279
|
}
|
|
301
280
|
NumericTypeNode.is = is;
|
|
302
281
|
})(NumericTypeNode || (NumericTypeNode = {}));
|
|
303
282
|
export const RangeExclusiveChar = '<';
|
|
283
|
+
export var RangeKind;
|
|
284
|
+
(function (RangeKind) {
|
|
285
|
+
function isLeftExclusive(rangeKind) {
|
|
286
|
+
return (rangeKind & 0b10) !== 0;
|
|
287
|
+
}
|
|
288
|
+
RangeKind.isLeftExclusive = isLeftExclusive;
|
|
289
|
+
function isRightExclusive(rangeKind) {
|
|
290
|
+
return (rangeKind & 0b01) !== 0;
|
|
291
|
+
}
|
|
292
|
+
RangeKind.isRightExclusive = isRightExclusive;
|
|
293
|
+
})(RangeKind || (RangeKind = {}));
|
|
304
294
|
export function getRangeDelimiter(kind) {
|
|
305
295
|
const prefix = kind & 0b10 ? RangeExclusiveChar : '';
|
|
306
296
|
const suffix = kind & 0b01 ? RangeExclusiveChar : '';
|
|
@@ -331,11 +321,7 @@ function destructRangeNode(node) {
|
|
|
331
321
|
kind = getKind(node.children[1]);
|
|
332
322
|
min = node.children[0];
|
|
333
323
|
}
|
|
334
|
-
return {
|
|
335
|
-
kind,
|
|
336
|
-
min,
|
|
337
|
-
max,
|
|
338
|
-
};
|
|
324
|
+
return { kind, min, max };
|
|
339
325
|
function getKind(delimiter) {
|
|
340
326
|
let ans = 0b00;
|
|
341
327
|
if (delimiter.value.startsWith(RangeExclusiveChar)) {
|
|
@@ -377,16 +363,11 @@ export var PrimitiveArrayTypeNode;
|
|
|
377
363
|
}
|
|
378
364
|
}
|
|
379
365
|
}
|
|
380
|
-
return {
|
|
381
|
-
arrayKind: node.children.find(LiteralNode.is),
|
|
382
|
-
lengthRange,
|
|
383
|
-
valueRange,
|
|
384
|
-
};
|
|
366
|
+
return { arrayKind: node.children.find(LiteralNode.is), lengthRange, valueRange };
|
|
385
367
|
}
|
|
386
368
|
PrimitiveArrayTypeNode.destruct = destruct;
|
|
387
369
|
function is(node) {
|
|
388
|
-
return (node?.type ===
|
|
389
|
-
'mcdoc:type/primitive_array');
|
|
370
|
+
return (node?.type === 'mcdoc:type/primitive_array');
|
|
390
371
|
}
|
|
391
372
|
PrimitiveArrayTypeNode.is = is;
|
|
392
373
|
})(PrimitiveArrayTypeNode || (PrimitiveArrayTypeNode = {}));
|
|
@@ -407,9 +388,7 @@ export var ListTypeNode;
|
|
|
407
388
|
export var StringTypeNode;
|
|
408
389
|
(function (StringTypeNode) {
|
|
409
390
|
function destruct(node) {
|
|
410
|
-
return {
|
|
411
|
-
lengthRange: node.children.find(IntRangeNode.is),
|
|
412
|
-
};
|
|
391
|
+
return { lengthRange: node.children.find(IntRangeNode.is) };
|
|
413
392
|
}
|
|
414
393
|
StringTypeNode.destruct = destruct;
|
|
415
394
|
function is(node) {
|
|
@@ -420,9 +399,7 @@ export var StringTypeNode;
|
|
|
420
399
|
export var TupleTypeNode;
|
|
421
400
|
(function (TupleTypeNode) {
|
|
422
401
|
function destruct(node) {
|
|
423
|
-
return {
|
|
424
|
-
items: node.children.filter(TypeNode.is),
|
|
425
|
-
};
|
|
402
|
+
return { items: node.children.filter(TypeNode.is) };
|
|
426
403
|
}
|
|
427
404
|
TupleTypeNode.destruct = destruct;
|
|
428
405
|
function is(node) {
|
|
@@ -432,15 +409,7 @@ export var TupleTypeNode;
|
|
|
432
409
|
})(TupleTypeNode || (TupleTypeNode = {}));
|
|
433
410
|
export var EnumNode;
|
|
434
411
|
(function (EnumNode) {
|
|
435
|
-
EnumNode.Kinds = new Set([
|
|
436
|
-
'byte',
|
|
437
|
-
'short',
|
|
438
|
-
'int',
|
|
439
|
-
'long',
|
|
440
|
-
'float',
|
|
441
|
-
'double',
|
|
442
|
-
'string',
|
|
443
|
-
]);
|
|
412
|
+
EnumNode.Kinds = new Set(['byte', 'short', 'int', 'long', 'float', 'double', 'string']);
|
|
444
413
|
function destruct(node) {
|
|
445
414
|
return {
|
|
446
415
|
block: node.children.find(EnumBlockNode.is),
|
|
@@ -486,17 +455,14 @@ export var DocCommentsNode;
|
|
|
486
455
|
}
|
|
487
456
|
DocCommentsNode.asText = asText;
|
|
488
457
|
function is(node) {
|
|
489
|
-
return node?.type ===
|
|
490
|
-
'mcdoc:doc_comments';
|
|
458
|
+
return node?.type === 'mcdoc:doc_comments';
|
|
491
459
|
}
|
|
492
460
|
DocCommentsNode.is = is;
|
|
493
461
|
})(DocCommentsNode || (DocCommentsNode = {}));
|
|
494
462
|
export var EnumBlockNode;
|
|
495
463
|
(function (EnumBlockNode) {
|
|
496
464
|
function destruct(node) {
|
|
497
|
-
return {
|
|
498
|
-
fields: node.children.filter(EnumFieldNode.is),
|
|
499
|
-
};
|
|
465
|
+
return { fields: node.children.filter(EnumFieldNode.is) };
|
|
500
466
|
}
|
|
501
467
|
EnumBlockNode.destruct = destruct;
|
|
502
468
|
function is(node) {
|
|
@@ -552,28 +518,22 @@ export var StructNode;
|
|
|
552
518
|
export var ReferenceTypeNode;
|
|
553
519
|
(function (ReferenceTypeNode) {
|
|
554
520
|
function destruct(node) {
|
|
555
|
-
return {
|
|
556
|
-
path: node.children.find(PathNode.is),
|
|
557
|
-
};
|
|
521
|
+
return { path: node.children.find(PathNode.is) };
|
|
558
522
|
}
|
|
559
523
|
ReferenceTypeNode.destruct = destruct;
|
|
560
524
|
function is(node) {
|
|
561
|
-
return (node?.type ===
|
|
562
|
-
'mcdoc:type/reference');
|
|
525
|
+
return (node?.type === 'mcdoc:type/reference');
|
|
563
526
|
}
|
|
564
527
|
ReferenceTypeNode.is = is;
|
|
565
528
|
})(ReferenceTypeNode || (ReferenceTypeNode = {}));
|
|
566
529
|
export var TypeParamBlockNode;
|
|
567
530
|
(function (TypeParamBlockNode) {
|
|
568
531
|
function destruct(node) {
|
|
569
|
-
return {
|
|
570
|
-
params: node.children.filter(TypeParamNode.is),
|
|
571
|
-
};
|
|
532
|
+
return { params: node.children.filter(TypeParamNode.is) };
|
|
572
533
|
}
|
|
573
534
|
TypeParamBlockNode.destruct = destruct;
|
|
574
535
|
function is(node) {
|
|
575
|
-
return (node?.type ===
|
|
576
|
-
'mcdoc:type_param_block');
|
|
536
|
+
return (node?.type === 'mcdoc:type_param_block');
|
|
577
537
|
}
|
|
578
538
|
TypeParamBlockNode.is = is;
|
|
579
539
|
})(TypeParamBlockNode || (TypeParamBlockNode = {}));
|
|
@@ -610,14 +570,11 @@ export var PathNode;
|
|
|
610
570
|
export var StructBlockNode;
|
|
611
571
|
(function (StructBlockNode) {
|
|
612
572
|
function destruct(node) {
|
|
613
|
-
return {
|
|
614
|
-
fields: node.children.filter(StructFieldNode.is),
|
|
615
|
-
};
|
|
573
|
+
return { fields: node.children.filter(StructFieldNode.is) };
|
|
616
574
|
}
|
|
617
575
|
StructBlockNode.destruct = destruct;
|
|
618
576
|
function is(node) {
|
|
619
|
-
return node?.type ===
|
|
620
|
-
'mcdoc:struct/block';
|
|
577
|
+
return node?.type === 'mcdoc:struct/block';
|
|
621
578
|
}
|
|
622
579
|
StructBlockNode.is = is;
|
|
623
580
|
})(StructBlockNode || (StructBlockNode = {}));
|
|
@@ -633,6 +590,7 @@ export var StructPairFieldNode;
|
|
|
633
590
|
function destruct(node) {
|
|
634
591
|
return {
|
|
635
592
|
attributes: node.children.filter(AttributeNode.is),
|
|
593
|
+
docComments: node.children.find(DocCommentsNode.is),
|
|
636
594
|
key: node.children.find(StructKeyNode.is),
|
|
637
595
|
type: node.children.find(TypeNode.is),
|
|
638
596
|
isOptional: node.isOptional,
|
|
@@ -640,26 +598,21 @@ export var StructPairFieldNode;
|
|
|
640
598
|
}
|
|
641
599
|
StructPairFieldNode.destruct = destruct;
|
|
642
600
|
function is(node) {
|
|
643
|
-
return (node?.type ===
|
|
644
|
-
'mcdoc:struct/field/pair');
|
|
601
|
+
return (node?.type === 'mcdoc:struct/field/pair');
|
|
645
602
|
}
|
|
646
603
|
StructPairFieldNode.is = is;
|
|
647
604
|
})(StructPairFieldNode || (StructPairFieldNode = {}));
|
|
648
605
|
export var StructKeyNode;
|
|
649
606
|
(function (StructKeyNode) {
|
|
650
607
|
function is(node) {
|
|
651
|
-
return (StringNode.is(node) ||
|
|
652
|
-
IdentifierNode.is(node) ||
|
|
653
|
-
StructMapKeyNode.is(node));
|
|
608
|
+
return (StringNode.is(node) || IdentifierNode.is(node) || StructMapKeyNode.is(node));
|
|
654
609
|
}
|
|
655
610
|
StructKeyNode.is = is;
|
|
656
611
|
})(StructKeyNode || (StructKeyNode = {}));
|
|
657
612
|
export var StructMapKeyNode;
|
|
658
613
|
(function (StructMapKeyNode) {
|
|
659
614
|
function destruct(node) {
|
|
660
|
-
return {
|
|
661
|
-
type: node.children.find(TypeNode.is),
|
|
662
|
-
};
|
|
615
|
+
return { type: node.children.find(TypeNode.is) };
|
|
663
616
|
}
|
|
664
617
|
StructMapKeyNode.destruct = destruct;
|
|
665
618
|
function is(node) {
|
|
@@ -677,8 +630,7 @@ export var StructSpreadFieldNode;
|
|
|
677
630
|
}
|
|
678
631
|
StructSpreadFieldNode.destruct = destruct;
|
|
679
632
|
function is(node) {
|
|
680
|
-
return (node?.type ===
|
|
681
|
-
'mcdoc:struct/field/spread');
|
|
633
|
+
return (node?.type === 'mcdoc:struct/field/spread');
|
|
682
634
|
}
|
|
683
635
|
StructSpreadFieldNode.is = is;
|
|
684
636
|
})(StructSpreadFieldNode || (StructSpreadFieldNode = {}));
|
|
@@ -692,17 +644,14 @@ export var DispatcherTypeNode;
|
|
|
692
644
|
}
|
|
693
645
|
DispatcherTypeNode.destruct = destruct;
|
|
694
646
|
function is(node) {
|
|
695
|
-
return (node?.type ===
|
|
696
|
-
'mcdoc:type/dispatcher');
|
|
647
|
+
return (node?.type === 'mcdoc:type/dispatcher');
|
|
697
648
|
}
|
|
698
649
|
DispatcherTypeNode.is = is;
|
|
699
650
|
})(DispatcherTypeNode || (DispatcherTypeNode = {}));
|
|
700
651
|
export var UnionTypeNode;
|
|
701
652
|
(function (UnionTypeNode) {
|
|
702
653
|
function destruct(node) {
|
|
703
|
-
return {
|
|
704
|
-
members: node.children.filter(TypeNode.is),
|
|
705
|
-
};
|
|
654
|
+
return { members: node.children.filter(TypeNode.is) };
|
|
706
655
|
}
|
|
707
656
|
UnionTypeNode.destruct = destruct;
|
|
708
657
|
function is(node) {
|
|
@@ -713,9 +662,7 @@ export var UnionTypeNode;
|
|
|
713
662
|
export var InjectionNode;
|
|
714
663
|
(function (InjectionNode) {
|
|
715
664
|
function destruct(node) {
|
|
716
|
-
return {
|
|
717
|
-
injection: node.children.find(InjectionContentNode.is),
|
|
718
|
-
};
|
|
665
|
+
return { injection: node.children.find(InjectionContentNode.is) };
|
|
719
666
|
}
|
|
720
667
|
InjectionNode.destruct = destruct;
|
|
721
668
|
function is(node) {
|
|
@@ -733,16 +680,14 @@ export var InjectionContentNode;
|
|
|
733
680
|
export var EnumInjectionNode;
|
|
734
681
|
(function (EnumInjectionNode) {
|
|
735
682
|
function is(node) {
|
|
736
|
-
return (node?.type ===
|
|
737
|
-
'mcdoc:injection/enum');
|
|
683
|
+
return (node?.type === 'mcdoc:injection/enum');
|
|
738
684
|
}
|
|
739
685
|
EnumInjectionNode.is = is;
|
|
740
686
|
})(EnumInjectionNode || (EnumInjectionNode = {}));
|
|
741
687
|
export var StructInjectionNode;
|
|
742
688
|
(function (StructInjectionNode) {
|
|
743
689
|
function is(node) {
|
|
744
|
-
return (node?.type ===
|
|
745
|
-
'mcdoc:injection/struct');
|
|
690
|
+
return (node?.type === 'mcdoc:injection/struct');
|
|
746
691
|
}
|
|
747
692
|
StructInjectionNode.is = is;
|
|
748
693
|
})(StructInjectionNode || (StructInjectionNode = {}));
|