json-as 1.2.1 → 1.2.2-beta.1

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.
Files changed (79) hide show
  1. package/package.json +1 -1
  2. package/.github/FUNDING.yml +0 -1
  3. package/.github/dependabot.yml +0 -11
  4. package/.github/workflows/benchmark.yml +0 -72
  5. package/.github/workflows/release-package.yml +0 -47
  6. package/.github/workflows/tests.yml +0 -25
  7. package/.prettierignore +0 -9
  8. package/.prettierrc.json +0 -7
  9. package/.trunk/configs/.markdownlint.yaml +0 -2
  10. package/.trunk/configs/.shellcheckrc +0 -7
  11. package/.trunk/configs/.yamllint.yaml +0 -7
  12. package/.trunk/trunk.yaml +0 -37
  13. package/CHANGELOG.md +0 -334
  14. package/SECURITY.md +0 -32
  15. package/asconfig.json +0 -7
  16. package/assembly/__benches__/abc.bench.ts +0 -28
  17. package/assembly/__benches__/large.bench.ts +0 -238
  18. package/assembly/__benches__/lib/bench.ts +0 -85
  19. package/assembly/__benches__/medium.bench.ts +0 -128
  20. package/assembly/__benches__/small.bench.ts +0 -46
  21. package/assembly/__benches__/throughput.ts +0 -172
  22. package/assembly/__benches__/vec3.bench.ts +0 -37
  23. package/assembly/__tests__/arbitrary.spec.ts +0 -35
  24. package/assembly/__tests__/array.spec.ts +0 -145
  25. package/assembly/__tests__/bool.spec.ts +0 -12
  26. package/assembly/__tests__/box.spec.ts +0 -27
  27. package/assembly/__tests__/custom.spec.ts +0 -56
  28. package/assembly/__tests__/date.spec.ts +0 -36
  29. package/assembly/__tests__/enum.spec.ts +0 -35
  30. package/assembly/__tests__/float.spec.ts +0 -42
  31. package/assembly/__tests__/generics.spec.ts +0 -49
  32. package/assembly/__tests__/hierarchy.spec.ts +0 -61
  33. package/assembly/__tests__/integer.spec.ts +0 -26
  34. package/assembly/__tests__/lib/index.ts +0 -41
  35. package/assembly/__tests__/map.spec.ts +0 -7
  36. package/assembly/__tests__/namespace.spec.ts +0 -63
  37. package/assembly/__tests__/null.spec.ts +0 -12
  38. package/assembly/__tests__/raw.spec.ts +0 -23
  39. package/assembly/__tests__/resolving.spec.ts +0 -55
  40. package/assembly/__tests__/staticarray.spec.ts +0 -12
  41. package/assembly/__tests__/string.spec.ts +0 -30
  42. package/assembly/__tests__/struct.spec.ts +0 -163
  43. package/assembly/__tests__/test.spec.ts +0 -3
  44. package/assembly/__tests__/types.spec.ts +0 -27
  45. package/assembly/__tests__/types.ts +0 -98
  46. package/assembly/test.tmp.ts +0 -133
  47. package/bench/abc.bench.ts +0 -25
  48. package/bench/large.bench.ts +0 -127
  49. package/bench/lib/bench.d.ts +0 -27
  50. package/bench/lib/bench.js +0 -53
  51. package/bench/lib/chart.ts +0 -217
  52. package/bench/medium.bench.ts +0 -68
  53. package/bench/runners/assemblyscript.js +0 -34
  54. package/bench/small.bench.ts +0 -34
  55. package/bench/throughput.ts +0 -87
  56. package/bench/tsconfig.json +0 -13
  57. package/bench/vec3.bench.ts +0 -30
  58. package/bench.ts +0 -18
  59. package/ci/bench/lib/bench.ts +0 -42
  60. package/ci/bench/runners/assemblyscript.js +0 -29
  61. package/ci/run-bench.as.sh +0 -63
  62. package/publish.sh +0 -78
  63. package/run-bench.as.sh +0 -60
  64. package/run-bench.js.sh +0 -36
  65. package/run-tests.sh +0 -51
  66. package/scripts/build-chart01.ts +0 -38
  67. package/scripts/build-chart02.ts +0 -38
  68. package/scripts/build-chart03.ts +0 -139
  69. package/scripts/build-chart05.ts +0 -47
  70. package/scripts/generate-as-class.ts +0 -50
  71. package/scripts/lib/bench-utils.ts +0 -308
  72. package/transform/src/builder.ts +0 -1375
  73. package/transform/src/index.ts +0 -1486
  74. package/transform/src/linkers/alias.ts +0 -58
  75. package/transform/src/linkers/custom.ts +0 -32
  76. package/transform/src/linkers/imports.ts +0 -22
  77. package/transform/src/types.ts +0 -300
  78. package/transform/src/util.ts +0 -128
  79. package/transform/src/visitor.ts +0 -530
@@ -1,530 +0,0 @@
1
- import { ArrayLiteralExpression, AssertionExpression, BinaryExpression, CallExpression, ElementAccessExpression, FloatLiteralExpression, FunctionTypeNode, IdentifierExpression, NamedTypeNode, Node, ObjectLiteralExpression, Source, TypeParameterNode, BlockStatement, BreakStatement, ClassDeclaration, ClassExpression, CommaExpression, ContinueStatement, DecoratorNode, DoStatement, EmptyStatement, EnumDeclaration, EnumValueDeclaration, ExportDefaultStatement, ExportImportStatement, ExportMember, ExportStatement, ExpressionStatement, FieldDeclaration, ForStatement, FunctionDeclaration, FunctionExpression, IfStatement, ImportDeclaration, ImportStatement, IndexSignatureNode, InstanceOfExpression, IntegerLiteralExpression, InterfaceDeclaration, LiteralExpression, MethodDeclaration, NamespaceDeclaration, NewExpression, ParameterNode, ParenthesizedExpression, PropertyAccessExpression, RegexpLiteralExpression, ReturnStatement, StringLiteralExpression, SwitchCase, SwitchStatement, TemplateLiteralExpression, TernaryExpression, ThrowStatement, TryStatement, TypeDeclaration, TypeName, UnaryPostfixExpression, UnaryPrefixExpression, VariableDeclaration, VariableStatement, WhileStatement, NodeKind, TypeNode, Expression, LiteralKind, UnaryExpression, SuperExpression, FalseExpression, TrueExpression, ThisExpression, NullExpression, ConstructorExpression, Statement, VoidStatement, CompiledExpression, CommentNode, Module, OmittedExpression, ForOfStatement, ModuleDeclaration } from "assemblyscript/dist/assemblyscript.js";
2
-
3
- export class Visitor {
4
- public currentSource: Source | null = null;
5
- visit(node: Node | Node[], ref: Node | null = null): void {
6
- if (node == null) return;
7
- if (node instanceof Array) {
8
- for (const n of node) {
9
- this._visit(n, ref);
10
- }
11
- } else {
12
- // @ts-ignore
13
- this._visit(node, ref);
14
- }
15
- }
16
- _visit(node: Node, ref: Node | null): void {
17
- switch (node.kind) {
18
- case NodeKind.Source:
19
- this.visitSource(node as Source, ref);
20
- break;
21
- case NodeKind.NamedType:
22
- this.visitNamedTypeNode(node as NamedTypeNode, ref);
23
- break;
24
- case NodeKind.FunctionType:
25
- this.visitFunctionTypeNode(node as FunctionTypeNode, ref);
26
- break;
27
- case NodeKind.TypeName:
28
- this.visitTypeName(node as TypeName, ref);
29
- break;
30
- case NodeKind.TypeParameter:
31
- this.visitTypeParameter(node as TypeParameterNode, ref);
32
- break;
33
- case NodeKind.Identifier:
34
- this.visitIdentifierExpression(node as IdentifierExpression, ref);
35
- break;
36
- case NodeKind.Assertion:
37
- this.visitAssertionExpression(node as AssertionExpression, ref);
38
- break;
39
- case NodeKind.Binary:
40
- this.visitBinaryExpression(node as BinaryExpression, ref);
41
- break;
42
- case NodeKind.Call:
43
- this.visitCallExpression(node as CallExpression, ref);
44
- break;
45
- case NodeKind.Class:
46
- this.visitClassExpression(node as ClassExpression, ref);
47
- break;
48
- case NodeKind.Comma:
49
- this.visitCommaExpression(node as CommaExpression, ref);
50
- break;
51
- case NodeKind.ElementAccess:
52
- this.visitElementAccessExpression(node as ElementAccessExpression, ref);
53
- break;
54
- case NodeKind.Function:
55
- this.visitFunctionExpression(node as FunctionExpression, ref);
56
- break;
57
- case NodeKind.InstanceOf:
58
- this.visitInstanceOfExpression(node as InstanceOfExpression, ref);
59
- break;
60
- case NodeKind.Literal:
61
- this.visitLiteralExpression(node as LiteralExpression, ref);
62
- break;
63
- case NodeKind.New:
64
- this.visitNewExpression(node as NewExpression, ref);
65
- break;
66
- case NodeKind.Parenthesized:
67
- this.visitParenthesizedExpression(node as ParenthesizedExpression, ref);
68
- break;
69
- case NodeKind.PropertyAccess:
70
- this.visitPropertyAccessExpression(node as PropertyAccessExpression, ref);
71
- break;
72
- case NodeKind.Ternary:
73
- this.visitTernaryExpression(node as TernaryExpression, ref);
74
- break;
75
- case NodeKind.UnaryPostfix:
76
- this.visitUnaryPostfixExpression(node as UnaryPostfixExpression, ref);
77
- break;
78
- case NodeKind.UnaryPrefix:
79
- this.visitUnaryPrefixExpression(node as UnaryPrefixExpression, ref);
80
- break;
81
- case NodeKind.Block:
82
- this.visitBlockStatement(node as BlockStatement, ref);
83
- break;
84
- case NodeKind.Break:
85
- this.visitBreakStatement(node as BreakStatement, ref);
86
- break;
87
- case NodeKind.Continue:
88
- this.visitContinueStatement(node as ContinueStatement, ref);
89
- break;
90
- case NodeKind.Do:
91
- this.visitDoStatement(node as DoStatement, ref);
92
- break;
93
- case NodeKind.Empty:
94
- this.visitEmptyStatement(node as EmptyStatement, ref);
95
- break;
96
- case NodeKind.Export:
97
- this.visitExportStatement(node as ExportStatement, ref);
98
- break;
99
- case NodeKind.ExportDefault:
100
- this.visitExportDefaultStatement(node as ExportDefaultStatement, ref);
101
- break;
102
- case NodeKind.ExportImport:
103
- this.visitExportImportStatement(node as ExportImportStatement, ref);
104
- break;
105
- case NodeKind.Expression:
106
- this.visitExpressionStatement(node as ExpressionStatement, ref);
107
- break;
108
- case NodeKind.For:
109
- this.visitForStatement(node as ForStatement, ref);
110
- break;
111
- case NodeKind.If:
112
- this.visitIfStatement(node as IfStatement, ref);
113
- break;
114
- case NodeKind.Import:
115
- this.visitImportStatement(node as ImportStatement, ref);
116
- break;
117
- case NodeKind.Return:
118
- this.visitReturnStatement(node as ReturnStatement, ref);
119
- break;
120
- case NodeKind.Switch:
121
- this.visitSwitchStatement(node as SwitchStatement, ref);
122
- break;
123
- case NodeKind.Throw:
124
- this.visitThrowStatement(node as ThrowStatement, ref);
125
- break;
126
- case NodeKind.Try:
127
- this.visitTryStatement(node as TryStatement, ref);
128
- break;
129
- case NodeKind.Variable:
130
- this.visitVariableStatement(node as VariableStatement, ref);
131
- break;
132
- case NodeKind.While:
133
- this.visitWhileStatement(node as WhileStatement, ref);
134
- break;
135
- case NodeKind.ClassDeclaration:
136
- this.visitClassDeclaration(node as ClassDeclaration, false, ref);
137
- break;
138
- case NodeKind.EnumDeclaration:
139
- this.visitEnumDeclaration(node as EnumDeclaration, false, ref);
140
- break;
141
- case NodeKind.EnumValueDeclaration:
142
- this.visitEnumValueDeclaration(node as EnumValueDeclaration, ref);
143
- break;
144
- case NodeKind.FieldDeclaration:
145
- this.visitFieldDeclaration(node as FieldDeclaration, ref);
146
- break;
147
- case NodeKind.FunctionDeclaration:
148
- this.visitFunctionDeclaration(node as FunctionDeclaration, false, ref);
149
- break;
150
- case NodeKind.ImportDeclaration:
151
- this.visitImportDeclaration(node as ImportDeclaration, ref);
152
- break;
153
- case NodeKind.InterfaceDeclaration:
154
- this.visitInterfaceDeclaration(node as InterfaceDeclaration, false, ref);
155
- break;
156
- case NodeKind.MethodDeclaration:
157
- this.visitMethodDeclaration(node as MethodDeclaration, ref);
158
- break;
159
- case NodeKind.NamespaceDeclaration:
160
- this.visitNamespaceDeclaration(node as NamespaceDeclaration, false, ref);
161
- break;
162
- case NodeKind.TypeDeclaration:
163
- this.visitTypeDeclaration(node as TypeDeclaration, ref);
164
- break;
165
- case NodeKind.VariableDeclaration:
166
- this.visitVariableDeclaration(node as VariableDeclaration, ref);
167
- break;
168
- case NodeKind.Decorator:
169
- this.visitDecoratorNode(node as DecoratorNode, ref);
170
- break;
171
- case NodeKind.ExportMember:
172
- this.visitExportMember(node as ExportMember, ref);
173
- break;
174
- case NodeKind.SwitchCase:
175
- this.visitSwitchCase(node as SwitchCase, ref);
176
- break;
177
- case NodeKind.IndexSignature:
178
- this.visitIndexSignature(node as IndexSignatureNode, ref);
179
- break;
180
- case NodeKind.Null:
181
- this.visitNullExpression(node as NullExpression, ref);
182
- break;
183
- case NodeKind.True: {
184
- this.visitTrueExpression(node as TrueExpression, ref);
185
- break;
186
- }
187
- case NodeKind.False: {
188
- this.visitFalseExpression(node as FalseExpression, ref);
189
- break;
190
- }
191
- case NodeKind.Compiled: {
192
- this.visitCompiledExpression(node as CompiledExpression, ref);
193
- break;
194
- }
195
- case NodeKind.Constructor: {
196
- this.visitConstructorExpression(node as ConstructorExpression, ref);
197
- break;
198
- }
199
- case NodeKind.Comment: {
200
- this.visitComment(node as CommentNode, ref);
201
- break;
202
- }
203
- case NodeKind.ForOf: {
204
- this.visitForOfStatement(node as ForOfStatement, ref);
205
- break;
206
- }
207
- case NodeKind.Module: {
208
- this.visitModuleDeclaration(node as ModuleDeclaration, ref);
209
- break;
210
- }
211
- case NodeKind.Omitted: {
212
- this.visitOmittedExpression(node as OmittedExpression, ref);
213
- break;
214
- }
215
- case NodeKind.Parameter: {
216
- this.visitParameter(node as ParameterNode, ref);
217
- break;
218
- }
219
- case NodeKind.Super: {
220
- this.visitSuperExpression(node as SuperExpression, ref);
221
- break;
222
- }
223
- case NodeKind.This: {
224
- this.visitThisExpression(node as ThisExpression, ref);
225
- break;
226
- }
227
- case NodeKind.Void: {
228
- this.visitVoidStatement(node as VoidStatement, ref);
229
- break;
230
- }
231
- default:
232
- throw new Error("Could not visit invalid type!");
233
- }
234
- }
235
- visitSource(node: Source, ref: Node | null = null): void {
236
- this.currentSource = node;
237
- this.visit(node.statements, node);
238
- this.currentSource = null;
239
- }
240
- visitTypeNode(node: TypeNode, ref: Node | null = null): void {}
241
- visitTypeName(node: TypeName, ref: Node | null = null): void {
242
- this.visit(node.identifier, node);
243
- this.visit(node.next, node);
244
- }
245
- visitNamedTypeNode(node: NamedTypeNode, ref: Node | null = null): void {
246
- this.visit(node.name, node);
247
- this.visit(node.typeArguments, node);
248
- }
249
- visitFunctionTypeNode(node: FunctionTypeNode, ref: Node | null = null): void {
250
- this.visit(node.parameters, node);
251
- this.visit(node.returnType, node);
252
- this.visit(node.explicitThisType, node);
253
- }
254
- visitTypeParameter(node: TypeParameterNode, ref: Node | null = null): void {
255
- this.visit(node.name, node);
256
- this.visit(node.extendsType, node);
257
- this.visit(node.defaultType, node);
258
- }
259
- visitIdentifierExpression(node: IdentifierExpression, ref: Node | null = null): void {}
260
- visitArrayLiteralExpression(node: ArrayLiteralExpression, ref: Node | null = null): void {
261
- this.visit(node.elementExpressions, node);
262
- }
263
- visitObjectLiteralExpression(node: ObjectLiteralExpression, ref: Node | null = null): void {
264
- this.visit(node.names, node);
265
- this.visit(node.values, node);
266
- }
267
- visitAssertionExpression(node: AssertionExpression, ref: Node | null = null): void {
268
- this.visit(node.toType, node);
269
- this.visit(node.expression, node);
270
- }
271
- visitBinaryExpression(node: BinaryExpression, ref: Node | null = null): void {
272
- this.visit(node.left, node);
273
- this.visit(node.right, node);
274
- }
275
- visitCallExpression(node: CallExpression, ref: Node | null = null): void {
276
- this.visit(node.expression, node);
277
- this.visit(node.typeArguments, node);
278
- this.visit(node.args, node);
279
- }
280
- visitClassExpression(node: ClassExpression, ref: Node | null = null): void {
281
- this.visit(node.declaration, node);
282
- }
283
- visitCommaExpression(node: CommaExpression, ref: Node | null = null): void {
284
- this.visit(node.expressions, node);
285
- }
286
- visitElementAccessExpression(node: ElementAccessExpression, ref: Node | null = null): void {
287
- this.visit(node.elementExpression, node);
288
- this.visit(node.expression, node);
289
- }
290
- visitFunctionExpression(node: FunctionExpression, ref: Node | null = null): void {
291
- this.visit(node.declaration, node);
292
- }
293
- visitLiteralExpression(node: LiteralExpression, ref: Node | null = null): void {
294
- switch (node.literalKind) {
295
- case LiteralKind.Float:
296
- this.visitFloatLiteralExpression(node as FloatLiteralExpression);
297
- break;
298
- case LiteralKind.Integer:
299
- this.visitIntegerLiteralExpression(node as IntegerLiteralExpression);
300
- break;
301
- case LiteralKind.String:
302
- this.visitStringLiteralExpression(node as StringLiteralExpression);
303
- break;
304
- case LiteralKind.Template:
305
- this.visitTemplateLiteralExpression(node as TemplateLiteralExpression);
306
- break;
307
- case LiteralKind.RegExp:
308
- this.visitRegexpLiteralExpression(node as RegexpLiteralExpression);
309
- break;
310
- case LiteralKind.Array:
311
- this.visitArrayLiteralExpression(node as ArrayLiteralExpression);
312
- break;
313
- case LiteralKind.Object:
314
- this.visitObjectLiteralExpression(node as ObjectLiteralExpression);
315
- break;
316
- default:
317
- throw new Error("Invalid LiteralKind at visitLiteralExpression(): " + node.literalKind);
318
- }
319
- }
320
- visitFloatLiteralExpression(node: FloatLiteralExpression, ref: Node | null = null): void {}
321
- visitInstanceOfExpression(node: InstanceOfExpression, ref: Node | null = null): void {
322
- this.visit(node.expression, node);
323
- this.visit(node.isType, node);
324
- }
325
- visitIntegerLiteralExpression(node: IntegerLiteralExpression, ref: Node | null = null): void {}
326
- visitStringLiteralExpression(node: StringLiteralExpression, ref: Node | null = null): void {}
327
- visitTemplateLiteralExpression(node: TemplateLiteralExpression, ref: Node | null = null): void {}
328
- visitRegexpLiteralExpression(node: RegexpLiteralExpression, ref: Node | null = null): void {}
329
- visitNewExpression(node: NewExpression, ref: Node | null = null): void {
330
- this.visit(node.typeName, node);
331
- this.visit(node.typeArguments, node);
332
- this.visit(node.args, node);
333
- }
334
- visitParenthesizedExpression(node: ParenthesizedExpression, ref: Node | null = null): void {
335
- this.visit(node.expression, node);
336
- }
337
- visitPropertyAccessExpression(node: PropertyAccessExpression, ref: Node | null = null): void {
338
- this.visit(node.property, node);
339
- this.visit(node.expression, node);
340
- }
341
- visitTernaryExpression(node: TernaryExpression, ref: Node | null = null): void {
342
- this.visit(node.condition, node);
343
- this.visit(node.ifThen, node);
344
- this.visit(node.ifElse, node);
345
- }
346
- visitUnaryExpression(node: UnaryExpression, ref: Node | null = null): void {
347
- this.visit(node.operand, node);
348
- }
349
- visitUnaryPostfixExpression(node: UnaryPostfixExpression, ref: Node | null = null): void {
350
- this.visit(node.operand, node);
351
- }
352
- visitUnaryPrefixExpression(node: UnaryPrefixExpression, ref: Node | null = null): void {
353
- this.visit(node.operand, node);
354
- }
355
- visitSuperExpression(node: SuperExpression, ref: Node | null = null): void {}
356
- visitFalseExpression(node: FalseExpression, ref: Node | null = null): void {}
357
- visitTrueExpression(node: TrueExpression, ref: Node | null = null): void {}
358
- visitThisExpression(node: ThisExpression, ref: Node | null = null): void {}
359
- visitNullExpression(node: NullExpression, ref: Node | null = null): void {}
360
- visitConstructorExpression(node: ConstructorExpression, ref: Node | null = null): void {}
361
- visitNodeAndTerminate(statement: Statement, ref: Node | null = null): void {}
362
- visitBlockStatement(node: BlockStatement, ref: Node | null = null): void {
363
- this.visit(node.statements, node);
364
- }
365
- visitBreakStatement(node: BreakStatement, ref: Node | null = null): void {
366
- this.visit(node.label, node);
367
- }
368
- visitContinueStatement(node: ContinueStatement, ref: Node | null = null): void {
369
- this.visit(node.label, node);
370
- }
371
- visitClassDeclaration(node: ClassDeclaration, isDefault: boolean = false, ref: Node | null = null): void {
372
- this.visit(node.name, node);
373
- this.visit(node.decorators, node);
374
- if (node.isGeneric ? node.typeParameters != null : node.typeParameters == null) {
375
- this.visit(node.typeParameters, node);
376
- this.visit(node.extendsType, node);
377
- this.visit(node.implementsTypes, node);
378
- this.visit(node.members, node);
379
- } else {
380
- throw new Error("Expected to type parameters to match class declaration, but found type mismatch instead!");
381
- }
382
- }
383
- visitDoStatement(node: DoStatement, ref: Node | null = null): void {
384
- this.visit(node.condition, node);
385
- this.visit(node.body, node);
386
- }
387
- visitEmptyStatement(node: EmptyStatement, ref: Node | null = null): void {}
388
- visitEnumDeclaration(node: EnumDeclaration, isDefault: boolean = false, ref: Node | null = null): void {
389
- this.visit(node.name, node);
390
- this.visit(node.decorators, node);
391
- this.visit(node.values, node);
392
- }
393
- visitEnumValueDeclaration(node: EnumValueDeclaration, ref: Node | null = null): void {
394
- this.visit(node.name, node);
395
- this.visit(node.initializer, node);
396
- }
397
- visitExportImportStatement(node: ExportImportStatement, ref: Node | null = null): void {
398
- this.visit(node.name, node);
399
- this.visit(node.externalName, node);
400
- }
401
- visitExportMember(node: ExportMember, ref: Node | null = null): void {
402
- this.visit(node.localName, node);
403
- this.visit(node.exportedName, node);
404
- }
405
- visitExportStatement(node: ExportStatement, ref: Node | null = null): void {
406
- this.visit(node.path, node);
407
- this.visit(node.members, node);
408
- }
409
- visitExportDefaultStatement(node: ExportDefaultStatement, ref: Node | null = null): void {
410
- this.visit(node.declaration, node);
411
- }
412
- visitExpressionStatement(node: ExpressionStatement, ref: Node | null = null): void {
413
- this.visit(node.expression, ref);
414
- }
415
- visitFieldDeclaration(node: FieldDeclaration, ref: Node | null = null): void {
416
- this.visit(node.name, node);
417
- this.visit(node.type, node);
418
- this.visit(node.initializer, node);
419
- this.visit(node.decorators, node);
420
- }
421
- visitForStatement(node: ForStatement, ref: Node | null = null): void {
422
- this.visit(node.initializer, node);
423
- this.visit(node.condition, node);
424
- this.visit(node.incrementor, node);
425
- this.visit(node.body, node);
426
- }
427
- visitFunctionDeclaration(node: FunctionDeclaration, isDefault: boolean = false, ref: Node | null = null): void {
428
- this.visit(node.name, node);
429
- this.visit(node.decorators, node);
430
- this.visit(node.typeParameters, node);
431
- this.visit(node.signature, node);
432
- this.visit(node.body, node);
433
- }
434
- visitIfStatement(node: IfStatement, ref: Node | null = null): void {
435
- this.visit(node.condition, node);
436
- this.visit(node.ifTrue, node);
437
- this.visit(node.ifFalse, node);
438
- }
439
- visitImportDeclaration(node: ImportDeclaration, ref: Node | null = null): void {
440
- this.visit(node.foreignName, node);
441
- this.visit(node.name, node);
442
- this.visit(node.decorators, node);
443
- }
444
- visitImportStatement(node: ImportStatement, ref: Node | null = null): void {
445
- this.visit(node.namespaceName, node);
446
- this.visit(node.declarations, node);
447
- }
448
- visitIndexSignature(node: IndexSignatureNode, ref: Node | null = null): void {
449
- this.visit(node.keyType, node);
450
- this.visit(node.valueType, node);
451
- }
452
- visitInterfaceDeclaration(node: InterfaceDeclaration, isDefault: boolean = false, ref: Node | null = null): void {
453
- this.visit(node.name, node);
454
- this.visit(node.typeParameters, node);
455
- this.visit(node.implementsTypes, node);
456
- this.visit(node.extendsType, node);
457
- this.visit(node.members, node);
458
- }
459
- visitMethodDeclaration(node: MethodDeclaration, ref: Node | null = null): void {
460
- this.visit(node.name, node);
461
- this.visit(node.typeParameters, node);
462
- this.visit(node.signature, node);
463
- this.visit(node.decorators, node);
464
- this.visit(node.body, node);
465
- }
466
- visitNamespaceDeclaration(node: NamespaceDeclaration, isDefault: boolean = false, ref: Node | null = null): void {
467
- this.visit(node.name, node);
468
- this.visit(node.decorators, node);
469
- this.visit(node.members, node);
470
- }
471
- visitReturnStatement(node: ReturnStatement, ref: Node | null = null): void {
472
- this.visit(node.value, node);
473
- }
474
- visitSwitchCase(node: SwitchCase, ref: Node | null = null): void {
475
- this.visit(node.label, node);
476
- this.visit(node.statements, node);
477
- }
478
- visitSwitchStatement(node: SwitchStatement, ref: Node | null = null): void {
479
- this.visit(node.condition, node);
480
- this.visit(node.cases, node);
481
- }
482
- visitThrowStatement(node: ThrowStatement, ref: Node | null = null): void {
483
- this.visit(node.value, node);
484
- }
485
- visitTryStatement(node: TryStatement, ref: Node | null = null): void {
486
- this.visit(node.bodyStatements, node);
487
- this.visit(node.catchVariable, node);
488
- this.visit(node.catchStatements, node);
489
- this.visit(node.finallyStatements, node);
490
- }
491
- visitTypeDeclaration(node: TypeDeclaration, ref: Node | null = null): void {
492
- this.visit(node.name, node);
493
- this.visit(node.decorators, node);
494
- this.visit(node.type, node);
495
- this.visit(node.typeParameters, node);
496
- }
497
- visitVariableDeclaration(node: VariableDeclaration, ref: Node | null = null): void {
498
- this.visit(node.name, node);
499
- this.visit(node.type, node);
500
- this.visit(node.initializer, node);
501
- }
502
- visitVariableStatement(node: VariableStatement, ref: Node | null = null): void {
503
- this.visit(node.decorators, node);
504
- this.visit(node.declarations, node);
505
- }
506
- visitWhileStatement(node: WhileStatement, ref: Node | null = null): void {
507
- this.visit(node.condition, node);
508
- this.visit(node.body, node);
509
- }
510
- visitVoidStatement(node: VoidStatement, ref: Node | null = null): void {}
511
- visitComment(node: CommentNode, ref: Node | null = null): void {}
512
- visitDecoratorNode(node: DecoratorNode, ref: Node | null = null): void {
513
- this.visit(node.name, node);
514
- this.visit(node.args, node);
515
- }
516
- visitParameter(node: ParameterNode, ref: Node | null = null): void {
517
- this.visit(node.name, node);
518
- this.visit(node.implicitFieldDeclaration, node);
519
- this.visit(node.initializer, node);
520
- this.visit(node.type, node);
521
- }
522
- visitCompiledExpression(node: CompiledExpression, ref: Node | null = null): void {}
523
- visitForOfStatement(node: ForOfStatement, ref: Node | null = null): void {
524
- this.visit(node.body, node);
525
- this.visit(node.variable, node);
526
- this.visit(node.iterable, node);
527
- }
528
- visitModuleDeclaration(node: ModuleDeclaration, ref: Node | null = null): void {}
529
- visitOmittedExpression(node: OmittedExpression, ref: Node | null = null): void {}
530
- }