[rust] SWC usage example
Basic example of parsing some code with SWC and then running name resolution.
Joe Savona committed
Jul 6, 2023 at 09:24 UTC
292f07e19f62f881e73cb111f8eeb7d7ee9e42d3
4 files changed
+1424
compiler/forget/Cargo.lock
new
+1344
@@ -0,0 +1,1344 @@
1
+# This file is automatically @generated by Cargo.
2
+# It is not intended for manual editing.
3
+version = 3
4
+
5
+[[package]]
6
+name = "Inflector"
7
+version = "0.11.4"
8
+source = "registry+https://github.com/rust-lang/crates.io-index"
9
+checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
10
+dependencies = [
11
+ "lazy_static",
12
+ "regex",
13
+]
14
+
15
+[[package]]
16
+name = "ahash"
17
+version = "0.8.3"
18
+source = "registry+https://github.com/rust-lang/crates.io-index"
19
+checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
20
+dependencies = [
21
+ "cfg-if",
22
+ "getrandom",
23
+ "once_cell",
24
+ "version_check",
25
+]
26
+
27
+[[package]]
28
+name = "aho-corasick"
29
+version = "1.0.2"
30
+source = "registry+https://github.com/rust-lang/crates.io-index"
31
+checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
32
+dependencies = [
33
+ "memchr",
34
+]
35
+
36
+[[package]]
37
+name = "anyhow"
38
+version = "1.0.71"
39
+source = "registry+https://github.com/rust-lang/crates.io-index"
40
+checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
41
+
42
+[[package]]
43
+name = "ast_node"
44
+version = "0.9.5"
45
+source = "registry+https://github.com/rust-lang/crates.io-index"
46
+checksum = "c09c69dffe06d222d072c878c3afe86eee2179806f20503faec97250268b4c24"
47
+dependencies = [
48
+ "pmutil",
49
+ "proc-macro2",
50
+ "quote",
51
+ "swc_macros_common",
52
+ "syn 2.0.18",
53
+]
54
+
55
+[[package]]
56
+name = "atty"
57
+version = "0.2.14"
58
+source = "registry+https://github.com/rust-lang/crates.io-index"
59
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
60
+dependencies = [
61
+ "hermit-abi 0.1.19",
62
+ "libc",
63
+ "winapi",
64
+]
65
+
66
+[[package]]
67
+name = "autocfg"
68
+version = "1.1.0"
69
+source = "registry+https://github.com/rust-lang/crates.io-index"
70
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
71
+
72
+[[package]]
73
+name = "better_scoped_tls"
74
+version = "0.1.1"
75
+source = "registry+https://github.com/rust-lang/crates.io-index"
76
+checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de"
77
+dependencies = [
78
+ "scoped-tls",
79
+]
80
+
81
+[[package]]
82
+name = "bitflags"
83
+version = "1.3.2"
84
+source = "registry+https://github.com/rust-lang/crates.io-index"
85
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
86
+
87
+[[package]]
88
+name = "bitflags"
89
+version = "2.3.2"
90
+source = "registry+https://github.com/rust-lang/crates.io-index"
91
+checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded"
92
+
93
+[[package]]
94
+name = "bumpalo"
95
+version = "3.13.0"
96
+source = "registry+https://github.com/rust-lang/crates.io-index"
97
+checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
98
+
99
+[[package]]
100
+name = "cc"
101
+version = "1.0.79"
102
+source = "registry+https://github.com/rust-lang/crates.io-index"
103
+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
104
+
105
+[[package]]
106
+name = "cfg-if"
107
+version = "1.0.0"
108
+source = "registry+https://github.com/rust-lang/crates.io-index"
109
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
110
+
111
+[[package]]
112
+name = "data-encoding"
113
+version = "2.4.0"
114
+source = "registry+https://github.com/rust-lang/crates.io-index"
115
+checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
116
+
117
+[[package]]
118
+name = "either"
119
+version = "1.8.1"
120
+source = "registry+https://github.com/rust-lang/crates.io-index"
121
+checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
122
+
123
+[[package]]
124
+name = "elsa"
125
+version = "1.8.1"
126
+source = "registry+https://github.com/rust-lang/crates.io-index"
127
+checksum = "b5e0aca8dce8856e420195bd13b6a64de3334235ccc9214e824b86b12bf26283"
128
+dependencies = [
129
+ "stable_deref_trait",
130
+]
131
+
132
+[[package]]
133
+name = "enum-iterator"
134
+version = "1.4.1"
135
+source = "registry+https://github.com/rust-lang/crates.io-index"
136
+checksum = "7add3873b5dd076766ee79c8e406ad1a472c385476b9e38849f8eec24f1be689"
137
+dependencies = [
138
+ "enum-iterator-derive",
139
+]
140
+
141
+[[package]]
142
+name = "enum-iterator-derive"
143
+version = "1.2.1"
144
+source = "registry+https://github.com/rust-lang/crates.io-index"
145
+checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb"
146
+dependencies = [
147
+ "proc-macro2",
148
+ "quote",
149
+ "syn 2.0.18",
150
+]
151
+
152
+[[package]]
153
+name = "estree"
154
+version = "0.1.0"
155
+dependencies = [
156
+ "bumpalo",
157
+ "elsa",
158
+ "serde",
159
+ "serde_json",
160
+]
161
+
162
+[[package]]
163
+name = "estree-swc"
164
+version = "0.1.0"
165
+dependencies = [
166
+ "estree",
167
+ "swc_common",
168
+ "swc_ecma_ast",
169
+]
170
+
171
+[[package]]
172
+name = "form_urlencoded"
173
+version = "1.2.0"
174
+source = "registry+https://github.com/rust-lang/crates.io-index"
175
+checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
176
+dependencies = [
177
+ "percent-encoding",
178
+]
179
+
180
+[[package]]
181
+name = "from_variant"
182
+version = "0.1.6"
183
+source = "registry+https://github.com/rust-lang/crates.io-index"
184
+checksum = "03ec5dc38ee19078d84a692b1c41181ff9f94331c76cee66ff0208c770b5e54f"
185
+dependencies = [
186
+ "pmutil",
187
+ "proc-macro2",
188
+ "swc_macros_common",
189
+ "syn 2.0.18",
190
+]
191
+
192
+[[package]]
193
+name = "getrandom"
194
+version = "0.2.10"
195
+source = "registry+https://github.com/rust-lang/crates.io-index"
196
+checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
197
+dependencies = [
198
+ "cfg-if",
199
+ "libc",
200
+ "wasi",
201
+]
202
+
203
+[[package]]
204
+name = "getset"
205
+version = "0.1.2"
206
+source = "registry+https://github.com/rust-lang/crates.io-index"
207
+checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9"
208
+dependencies = [
209
+ "proc-macro-error",
210
+ "proc-macro2",
211
+ "quote",
212
+ "syn 1.0.109",
213
+]
214
+
215
+[[package]]
216
+name = "hashbrown"
217
+version = "0.12.3"
218
+source = "registry+https://github.com/rust-lang/crates.io-index"
219
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
220
+
221
+[[package]]
222
+name = "hermit-abi"
223
+version = "0.1.19"
224
+source = "registry+https://github.com/rust-lang/crates.io-index"
225
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
226
+dependencies = [
227
+ "libc",
228
+]
229
+
230
+[[package]]
231
+name = "hermit-abi"
232
+version = "0.2.6"
233
+source = "registry+https://github.com/rust-lang/crates.io-index"
234
+checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
235
+dependencies = [
236
+ "libc",
237
+]
238
+
239
+[[package]]
240
+name = "idna"
241
+version = "0.4.0"
242
+source = "registry+https://github.com/rust-lang/crates.io-index"
243
+checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
244
+dependencies = [
245
+ "unicode-bidi",
246
+ "unicode-normalization",
247
+]
248
+
249
+[[package]]
250
+name = "if_chain"
251
+version = "1.0.2"
252
+source = "registry+https://github.com/rust-lang/crates.io-index"
253
+checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
254
+
255
+[[package]]
256
+name = "indexmap"
257
+version = "1.9.3"
258
+source = "registry+https://github.com/rust-lang/crates.io-index"
259
+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
260
+dependencies = [
261
+ "autocfg",
262
+ "hashbrown",
263
+]
264
+
265
+[[package]]
266
+name = "is-macro"
267
+version = "0.3.0"
268
+source = "registry+https://github.com/rust-lang/crates.io-index"
269
+checksum = "f4467ed1321b310c2625c5aa6c1b1ffc5de4d9e42668cf697a08fb033ee8265e"
270
+dependencies = [
271
+ "Inflector",
272
+ "pmutil",
273
+ "proc-macro2",
274
+ "quote",
275
+ "syn 2.0.18",
276
+]
277
+
278
+[[package]]
279
+name = "itoa"
280
+version = "1.0.6"
281
+source = "registry+https://github.com/rust-lang/crates.io-index"
282
+checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
283
+
284
+[[package]]
285
+name = "lazy_static"
286
+version = "1.4.0"
287
+source = "registry+https://github.com/rust-lang/crates.io-index"
288
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
289
+
290
+[[package]]
291
+name = "lexical"
292
+version = "6.1.1"
293
+source = "registry+https://github.com/rust-lang/crates.io-index"
294
+checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6"
295
+dependencies = [
296
+ "lexical-core",
297
+]
298
+
299
+[[package]]
300
+name = "lexical-core"
301
+version = "0.8.5"
302
+source = "registry+https://github.com/rust-lang/crates.io-index"
303
+checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46"
304
+dependencies = [
305
+ "lexical-parse-float",
306
+ "lexical-parse-integer",
307
+ "lexical-util",
308
+ "lexical-write-float",
309
+ "lexical-write-integer",
310
+]
311
+
312
+[[package]]
313
+name = "lexical-parse-float"
314
+version = "0.8.5"
315
+source = "registry+https://github.com/rust-lang/crates.io-index"
316
+checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f"
317
+dependencies = [
318
+ "lexical-parse-integer",
319
+ "lexical-util",
320
+ "static_assertions",
321
+]
322
+
323
+[[package]]
324
+name = "lexical-parse-integer"
325
+version = "0.8.6"
326
+source = "registry+https://github.com/rust-lang/crates.io-index"
327
+checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9"
328
+dependencies = [
329
+ "lexical-util",
330
+ "static_assertions",
331
+]
332
+
333
+[[package]]
334
+name = "lexical-util"
335
+version = "0.8.5"
336
+source = "registry+https://github.com/rust-lang/crates.io-index"
337
+checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc"
338
+dependencies = [
339
+ "static_assertions",
340
+]
341
+
342
+[[package]]
343
+name = "lexical-write-float"
344
+version = "0.8.5"
345
+source = "registry+https://github.com/rust-lang/crates.io-index"
346
+checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862"
347
+dependencies = [
348
+ "lexical-util",
349
+ "lexical-write-integer",
350
+ "static_assertions",
351
+]
352
+
353
+[[package]]
354
+name = "lexical-write-integer"
355
+version = "0.8.5"
356
+source = "registry+https://github.com/rust-lang/crates.io-index"
357
+checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446"
358
+dependencies = [
359
+ "lexical-util",
360
+ "static_assertions",
361
+]
362
+
363
+[[package]]
364
+name = "libc"
365
+version = "0.2.146"
366
+source = "registry+https://github.com/rust-lang/crates.io-index"
367
+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
368
+
369
+[[package]]
370
+name = "lock_api"
371
+version = "0.4.10"
372
+source = "registry+https://github.com/rust-lang/crates.io-index"
373
+checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
374
+dependencies = [
375
+ "autocfg",
376
+ "scopeguard",
377
+]
378
+
379
+[[package]]
380
+name = "memchr"
381
+version = "2.5.0"
382
+source = "registry+https://github.com/rust-lang/crates.io-index"
383
+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
384
+
385
+[[package]]
386
+name = "new_debug_unreachable"
387
+version = "1.0.4"
388
+source = "registry+https://github.com/rust-lang/crates.io-index"
389
+checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
390
+
391
+[[package]]
392
+name = "num-bigint"
393
+version = "0.4.3"
394
+source = "registry+https://github.com/rust-lang/crates.io-index"
395
+checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
396
+dependencies = [
397
+ "autocfg",
398
+ "num-integer",
399
+ "num-traits",
400
+ "serde",
401
+]
402
+
403
+[[package]]
404
+name = "num-integer"
405
+version = "0.1.45"
406
+source = "registry+https://github.com/rust-lang/crates.io-index"
407
+checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
408
+dependencies = [
409
+ "autocfg",
410
+ "num-traits",
411
+]
412
+
413
+[[package]]
414
+name = "num-traits"
415
+version = "0.2.15"
416
+source = "registry+https://github.com/rust-lang/crates.io-index"
417
+checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
418
+dependencies = [
419
+ "autocfg",
420
+]
421
+
422
+[[package]]
423
+name = "num_cpus"
424
+version = "1.15.0"
425
+source = "registry+https://github.com/rust-lang/crates.io-index"
426
+checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
427
+dependencies = [
428
+ "hermit-abi 0.2.6",
429
+ "libc",
430
+]
431
+
432
+[[package]]
433
+name = "once_cell"
434
+version = "1.18.0"
435
+source = "registry+https://github.com/rust-lang/crates.io-index"
436
+checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
437
+
438
+[[package]]
439
+name = "parking_lot"
440
+version = "0.12.1"
441
+source = "registry+https://github.com/rust-lang/crates.io-index"
442
+checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
443
+dependencies = [
444
+ "lock_api",
445
+ "parking_lot_core",
446
+]
447
+
448
+[[package]]
449
+name = "parking_lot_core"
450
+version = "0.9.8"
451
+source = "registry+https://github.com/rust-lang/crates.io-index"
452
+checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
453
+dependencies = [
454
+ "cfg-if",
455
+ "libc",
456
+ "redox_syscall",
457
+ "smallvec",
458
+ "windows-targets",
459
+]
460
+
461
+[[package]]
462
+name = "percent-encoding"
463
+version = "2.3.0"
464
+source = "registry+https://github.com/rust-lang/crates.io-index"
465
+checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
466
+
467
+[[package]]
468
+name = "phf"
469
+version = "0.10.1"
470
+source = "registry+https://github.com/rust-lang/crates.io-index"
471
+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
472
+dependencies = [
473
+ "phf_macros",
474
+ "phf_shared",
475
+ "proc-macro-hack",
476
+]
477
+
478
+[[package]]
479
+name = "phf_generator"
480
+version = "0.10.0"
481
+source = "registry+https://github.com/rust-lang/crates.io-index"
482
+checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
483
+dependencies = [
484
+ "phf_shared",
485
+ "rand",
486
+]
487
+
488
+[[package]]
489
+name = "phf_macros"
490
+version = "0.10.0"
491
+source = "registry+https://github.com/rust-lang/crates.io-index"
492
+checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0"
493
+dependencies = [
494
+ "phf_generator",
495
+ "phf_shared",
496
+ "proc-macro-hack",
497
+ "proc-macro2",
498
+ "quote",
499
+ "syn 1.0.109",
500
+]
501
+
502
+[[package]]
503
+name = "phf_shared"
504
+version = "0.10.0"
505
+source = "registry+https://github.com/rust-lang/crates.io-index"
506
+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
507
+dependencies = [
508
+ "siphasher",
509
+]
510
+
511
+[[package]]
512
+name = "pin-project-lite"
513
+version = "0.2.9"
514
+source = "registry+https://github.com/rust-lang/crates.io-index"
515
+checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
516
+
517
+[[package]]
518
+name = "pmutil"
519
+version = "0.6.1"
520
+source = "registry+https://github.com/rust-lang/crates.io-index"
521
+checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6"
522
+dependencies = [
523
+ "proc-macro2",
524
+ "quote",
525
+ "syn 2.0.18",
526
+]
527
+
528
+[[package]]
529
+name = "ppv-lite86"
530
+version = "0.2.17"
531
+source = "registry+https://github.com/rust-lang/crates.io-index"
532
+checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
533
+
534
+[[package]]
535
+name = "precomputed-hash"
536
+version = "0.1.1"
537
+source = "registry+https://github.com/rust-lang/crates.io-index"
538
+checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
539
+
540
+[[package]]
541
+name = "proc-macro-error"
542
+version = "1.0.4"
543
+source = "registry+https://github.com/rust-lang/crates.io-index"
544
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
545
+dependencies = [
546
+ "proc-macro-error-attr",
547
+ "proc-macro2",
548
+ "quote",
549
+ "syn 1.0.109",
550
+ "version_check",
551
+]
552
+
553
+[[package]]
554
+name = "proc-macro-error-attr"
555
+version = "1.0.4"
556
+source = "registry+https://github.com/rust-lang/crates.io-index"
557
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
558
+dependencies = [
559
+ "proc-macro2",
560
+ "quote",
561
+ "version_check",
562
+]
563
+
564
+[[package]]
565
+name = "proc-macro-hack"
566
+version = "0.5.20+deprecated"
567
+source = "registry+https://github.com/rust-lang/crates.io-index"
568
+checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
569
+
570
+[[package]]
571
+name = "proc-macro2"
572
+version = "1.0.60"
573
+source = "registry+https://github.com/rust-lang/crates.io-index"
574
+checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
575
+dependencies = [
576
+ "unicode-ident",
577
+]
578
+
579
+[[package]]
580
+name = "psm"
581
+version = "0.1.21"
582
+source = "registry+https://github.com/rust-lang/crates.io-index"
583
+checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874"
584
+dependencies = [
585
+ "cc",
586
+]
587
+
588
+[[package]]
589
+name = "quote"
590
+version = "1.0.28"
591
+source = "registry+https://github.com/rust-lang/crates.io-index"
592
+checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
593
+dependencies = [
594
+ "proc-macro2",
595
+]
596
+
597
+[[package]]
598
+name = "rand"
599
+version = "0.8.5"
600
+source = "registry+https://github.com/rust-lang/crates.io-index"
601
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
602
+dependencies = [
603
+ "libc",
604
+ "rand_chacha",
605
+ "rand_core",
606
+]
607
+
608
+[[package]]
609
+name = "rand_chacha"
610
+version = "0.3.1"
611
+source = "registry+https://github.com/rust-lang/crates.io-index"
612
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
613
+dependencies = [
614
+ "ppv-lite86",
615
+ "rand_core",
616
+]
617
+
618
+[[package]]
619
+name = "rand_core"
620
+version = "0.6.4"
621
+source = "registry+https://github.com/rust-lang/crates.io-index"
622
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
623
+dependencies = [
624
+ "getrandom",
625
+]
626
+
627
+[[package]]
628
+name = "redox_syscall"
629
+version = "0.3.5"
630
+source = "registry+https://github.com/rust-lang/crates.io-index"
631
+checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
632
+dependencies = [
633
+ "bitflags 1.3.2",
634
+]
635
+
636
+[[package]]
637
+name = "regex"
638
+version = "1.8.4"
639
+source = "registry+https://github.com/rust-lang/crates.io-index"
640
+checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
641
+dependencies = [
642
+ "aho-corasick",
643
+ "memchr",
644
+ "regex-syntax",
645
+]
646
+
647
+[[package]]
648
+name = "regex-syntax"
649
+version = "0.7.2"
650
+source = "registry+https://github.com/rust-lang/crates.io-index"
651
+checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
652
+
653
+[[package]]
654
+name = "rustc-hash"
655
+version = "1.1.0"
656
+source = "registry+https://github.com/rust-lang/crates.io-index"
657
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
658
+
659
+[[package]]
660
+name = "rustc_version"
661
+version = "0.2.3"
662
+source = "registry+https://github.com/rust-lang/crates.io-index"
663
+checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
664
+dependencies = [
665
+ "semver",
666
+]
667
+
668
+[[package]]
669
+name = "rustversion"
670
+version = "1.0.12"
671
+source = "registry+https://github.com/rust-lang/crates.io-index"
672
+checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
673
+
674
+[[package]]
675
+name = "ryu"
676
+version = "1.0.13"
677
+source = "registry+https://github.com/rust-lang/crates.io-index"
678
+checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
679
+
680
+[[package]]
681
+name = "scoped-tls"
682
+version = "1.0.1"
683
+source = "registry+https://github.com/rust-lang/crates.io-index"
684
+checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
685
+
686
+[[package]]
687
+name = "scopeguard"
688
+version = "1.1.0"
689
+source = "registry+https://github.com/rust-lang/crates.io-index"
690
+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
691
+
692
+[[package]]
693
+name = "semver"
694
+version = "0.9.0"
695
+source = "registry+https://github.com/rust-lang/crates.io-index"
696
+checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
697
+dependencies = [
698
+ "semver-parser",
699
+]
700
+
701
+[[package]]
702
+name = "semver-parser"
703
+version = "0.7.0"
704
+source = "registry+https://github.com/rust-lang/crates.io-index"
705
+checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
706
+
707
+[[package]]
708
+name = "serde"
709
+version = "1.0.164"
710
+source = "registry+https://github.com/rust-lang/crates.io-index"
711
+checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
712
+dependencies = [
713
+ "serde_derive",
714
+]
715
+
716
+[[package]]
717
+name = "serde_derive"
718
+version = "1.0.164"
719
+source = "registry+https://github.com/rust-lang/crates.io-index"
720
+checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
721
+dependencies = [
722
+ "proc-macro2",
723
+ "quote",
724
+ "syn 2.0.18",
725
+]
726
+
727
+[[package]]
728
+name = "serde_json"
729
+version = "1.0.99"
730
+source = "registry+https://github.com/rust-lang/crates.io-index"
731
+checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3"
732
+dependencies = [
733
+ "itoa",
734
+ "ryu",
735
+ "serde",
736
+]
737
+
738
+[[package]]
739
+name = "siphasher"
740
+version = "0.3.10"
741
+source = "registry+https://github.com/rust-lang/crates.io-index"
742
+checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
743
+
744
+[[package]]
745
+name = "smallvec"
746
+version = "1.10.0"
747
+source = "registry+https://github.com/rust-lang/crates.io-index"
748
+checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
749
+
750
+[[package]]
751
+name = "smartstring"
752
+version = "1.0.1"
753
+source = "registry+https://github.com/rust-lang/crates.io-index"
754
+checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29"
755
+dependencies = [
756
+ "autocfg",
757
+ "static_assertions",
758
+ "version_check",
759
+]
760
+
761
+[[package]]
762
+name = "sourcemap"
763
+version = "6.2.3"
764
+source = "registry+https://github.com/rust-lang/crates.io-index"
765
+checksum = "eed16231c92d0a6f0388f56e0ab2be24ecff1173f8e22f0ea5e074d0525631cb"
766
+dependencies = [
767
+ "data-encoding",
768
+ "if_chain",
769
+ "rustc_version",
770
+ "serde",
771
+ "serde_json",
772
+ "unicode-id",
773
+ "url",
774
+]
775
+
776
+[[package]]
777
+name = "stable_deref_trait"
778
+version = "1.2.0"
779
+source = "registry+https://github.com/rust-lang/crates.io-index"
780
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
781
+
782
+[[package]]
783
+name = "stacker"
784
+version = "0.1.15"
785
+source = "registry+https://github.com/rust-lang/crates.io-index"
786
+checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce"
787
+dependencies = [
788
+ "cc",
789
+ "cfg-if",
790
+ "libc",
791
+ "psm",
792
+ "winapi",
793
+]
794
+
795
+[[package]]
796
+name = "static_assertions"
797
+version = "1.1.0"
798
+source = "registry+https://github.com/rust-lang/crates.io-index"
799
+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
800
+
801
+[[package]]
802
+name = "string_cache"
803
+version = "0.8.7"
804
+source = "registry+https://github.com/rust-lang/crates.io-index"
805
+checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
806
+dependencies = [
807
+ "new_debug_unreachable",
808
+ "once_cell",
809
+ "parking_lot",
810
+ "phf_shared",
811
+ "precomputed-hash",
812
+ "serde",
813
+]
814
+
815
+[[package]]
816
+name = "string_cache_codegen"
817
+version = "0.5.2"
818
+source = "registry+https://github.com/rust-lang/crates.io-index"
819
+checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
820
+dependencies = [
821
+ "phf_generator",
822
+ "phf_shared",
823
+ "proc-macro2",
824
+ "quote",
825
+]
826
+
827
+[[package]]
828
+name = "string_enum"
829
+version = "0.4.1"
830
+source = "registry+https://github.com/rust-lang/crates.io-index"
831
+checksum = "8fa4d4f81d7c05b9161f8de839975d3326328b8ba2831164b465524cc2f55252"
832
+dependencies = [
833
+ "pmutil",
834
+ "proc-macro2",
835
+ "quote",
836
+ "swc_macros_common",
837
+ "syn 2.0.18",
838
+]
839
+
840
+[[package]]
841
+name = "swc-demo"
842
+version = "0.1.0"
843
+dependencies = [
844
+ "swc_common",
845
+ "swc_core",
846
+ "swc_ecma_parser",
847
+ "swc_ecma_transforms_base",
848
+ "swc_ecma_visit",
849
+ "swc_visit",
850
+]
851
+
852
+[[package]]
853
+name = "swc_atoms"
854
+version = "0.5.6"
855
+source = "registry+https://github.com/rust-lang/crates.io-index"
856
+checksum = "93d0307dc4bfd107d49c7528350c372758cfca94fb503629b9a056e6a1572860"
857
+dependencies = [
858
+ "once_cell",
859
+ "rustc-hash",
860
+ "serde",
861
+ "string_cache",
862
+ "string_cache_codegen",
863
+ "triomphe",
864
+]
865
+
866
+[[package]]
867
+name = "swc_common"
868
+version = "0.31.16"
869
+source = "registry+https://github.com/rust-lang/crates.io-index"
870
+checksum = "c6414bd4e553f5638961d39b07075ffd37a3d63176829592f4a5900260d94ca1"
871
+dependencies = [
872
+ "ahash",
873
+ "anyhow",
874
+ "ast_node",
875
+ "atty",
876
+ "better_scoped_tls",
877
+ "cfg-if",
878
+ "either",
879
+ "from_variant",
880
+ "new_debug_unreachable",
881
+ "num-bigint",
882
+ "once_cell",
883
+ "rustc-hash",
884
+ "serde",
885
+ "siphasher",
886
+ "sourcemap",
887
+ "string_cache",
888
+ "swc_atoms",
889
+ "swc_eq_ignore_macros",
890
+ "swc_visit",
891
+ "termcolor",
892
+ "tracing",
893
+ "unicode-width",
894
+ "url",
895
+]
896
+
897
+[[package]]
898
+name = "swc_core"
899
+version = "0.78.15"
900
+source = "registry+https://github.com/rust-lang/crates.io-index"
901
+checksum = "433f38bf3dd31fc55e6264479a889ea1bef3caec0df8e33358f3bf2de0e569c4"
902
+dependencies = [
903
+ "vergen",
904
+]
905
+
906
+[[package]]
907
+name = "swc_ecma_ast"
908
+version = "0.106.6"
909
+source = "registry+https://github.com/rust-lang/crates.io-index"
910
+checksum = "ebf4d6804b1da4146c4c0359d129e3dd43568d321f69d7953d9abbca4ded76ba"
911
+dependencies = [
912
+ "bitflags 2.3.2",
913
+ "is-macro",
914
+ "num-bigint",
915
+ "scoped-tls",
916
+ "serde",
917
+ "string_enum",
918
+ "swc_atoms",
919
+ "swc_common",
920
+ "unicode-id",
921
+]
922
+
923
+[[package]]
924
+name = "swc_ecma_parser"
925
+version = "0.136.2"
926
+source = "registry+https://github.com/rust-lang/crates.io-index"
927
+checksum = "d0ed358c991cf61d91b045769eb0336689549d6c444073c360ffa9a94af9e965"
928
+dependencies = [
929
+ "either",
930
+ "lexical",
931
+ "num-bigint",
932
+ "serde",
933
+ "smallvec",
934
+ "smartstring",
935
+ "stacker",
936
+ "swc_atoms",
937
+ "swc_common",
938
+ "swc_ecma_ast",
939
+ "tracing",
940
+ "typed-arena",
941
+]
942
+
943
+[[package]]
944
+name = "swc_ecma_transforms_base"
945
+version = "0.129.8"
946
+source = "registry+https://github.com/rust-lang/crates.io-index"
947
+checksum = "e659ba3b910dc0cc0deb8731293151f56054d603ee47f0042fda530b7d487517"
948
+dependencies = [
949
+ "better_scoped_tls",
950
+ "bitflags 2.3.2",
951
+ "indexmap",
952
+ "once_cell",
953
+ "phf",
954
+ "rustc-hash",
955
+ "serde",
956
+ "smallvec",
957
+ "swc_atoms",
958
+ "swc_common",
959
+ "swc_ecma_ast",
960
+ "swc_ecma_parser",
961
+ "swc_ecma_utils",
962
+ "swc_ecma_visit",
963
+ "tracing",
964
+]
965
+
966
+[[package]]
967
+name = "swc_ecma_utils"
968
+version = "0.119.4"
969
+source = "registry+https://github.com/rust-lang/crates.io-index"
970
+checksum = "266eaf9dc1ba58fca1fd34e97f9493e4df655eecde468104f32ab40d7147efac"
971
+dependencies = [
972
+ "indexmap",
973
+ "num_cpus",
974
+ "once_cell",
975
+ "rustc-hash",
976
+ "swc_atoms",
977
+ "swc_common",
978
+ "swc_ecma_ast",
979
+ "swc_ecma_visit",
980
+ "tracing",
981
+ "unicode-id",
982
+]
983
+
984
+[[package]]
985
+name = "swc_ecma_visit"
986
+version = "0.92.1"
987
+source = "registry+https://github.com/rust-lang/crates.io-index"
988
+checksum = "418a300bfde6ea4ab8e40e1ecdb3723f31ab3dbdbf9ac9e986164d63caba9d3e"
989
+dependencies = [
990
+ "num-bigint",
991
+ "swc_atoms",
992
+ "swc_common",
993
+ "swc_ecma_ast",
994
+ "swc_visit",
995
+ "tracing",
996
+]
997
+
998
+[[package]]
999
+name = "swc_eq_ignore_macros"
1000
+version = "0.1.2"
1001
+source = "registry+https://github.com/rust-lang/crates.io-index"
1002
+checksum = "05a95d367e228d52484c53336991fdcf47b6b553ef835d9159db4ba40efb0ee8"
1003
+dependencies = [
1004
+ "pmutil",
1005
+ "proc-macro2",
1006
+ "quote",
1007
+ "syn 2.0.18",
1008
+]
1009
+
1010
+[[package]]
1011
+name = "swc_macros_common"
1012
+version = "0.3.8"
1013
+source = "registry+https://github.com/rust-lang/crates.io-index"
1014
+checksum = "7a273205ccb09b51fabe88c49f3b34c5a4631c4c00a16ae20e03111d6a42e832"
1015
+dependencies = [
1016
+ "pmutil",
1017
+ "proc-macro2",
1018
+ "quote",
1019
+ "syn 2.0.18",
1020
+]
1021
+
1022
+[[package]]
1023
+name = "swc_visit"
1024
+version = "0.5.7"
1025
+source = "registry+https://github.com/rust-lang/crates.io-index"
1026
+checksum = "e87c337fbb2d191bf371173dea6a957f01899adb8f189c6c31b122a6cfc98fc3"
1027
+dependencies = [
1028
+ "either",
1029
+ "swc_visit_macros",
1030
+]
1031
+
1032
+[[package]]
1033
+name = "swc_visit_macros"
1034
+version = "0.5.8"
1035
+source = "registry+https://github.com/rust-lang/crates.io-index"
1036
+checksum = "0f322730fb82f3930a450ac24de8c98523af7d34ab8cb2f46bcb405839891a99"
1037
+dependencies = [
1038
+ "Inflector",
1039
+ "pmutil",
1040
+ "proc-macro2",
1041
+ "quote",
1042
+ "swc_macros_common",
1043
+ "syn 2.0.18",
1044
+]
1045
+
1046
+[[package]]
1047
+name = "syn"
1048
+version = "1.0.109"
1049
+source = "registry+https://github.com/rust-lang/crates.io-index"
1050
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
1051
+dependencies = [
1052
+ "proc-macro2",
1053
+ "quote",
1054
+ "unicode-ident",
1055
+]
1056
+
1057
+[[package]]
1058
+name = "syn"
1059
+version = "2.0.18"
1060
+source = "registry+https://github.com/rust-lang/crates.io-index"
1061
+checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
1062
+dependencies = [
1063
+ "proc-macro2",
1064
+ "quote",
1065
+ "unicode-ident",
1066
+]
1067
+
1068
+[[package]]
1069
+name = "termcolor"
1070
+version = "1.2.0"
1071
+source = "registry+https://github.com/rust-lang/crates.io-index"
1072
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
1073
+dependencies = [
1074
+ "winapi-util",
1075
+]
1076
+
1077
+[[package]]
1078
+name = "thiserror"
1079
+version = "1.0.40"
1080
+source = "registry+https://github.com/rust-lang/crates.io-index"
1081
+checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
1082
+dependencies = [
1083
+ "thiserror-impl",
1084
+]
1085
+
1086
+[[package]]
1087
+name = "thiserror-impl"
1088
+version = "1.0.40"
1089
+source = "registry+https://github.com/rust-lang/crates.io-index"
1090
+checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
1091
+dependencies = [
1092
+ "proc-macro2",
1093
+ "quote",
1094
+ "syn 2.0.18",
1095
+]
1096
+
1097
+[[package]]
1098
+name = "time"
1099
+version = "0.3.22"
1100
+source = "registry+https://github.com/rust-lang/crates.io-index"
1101
+checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd"
1102
+dependencies = [
1103
+ "itoa",
1104
+ "serde",
1105
+ "time-core",
1106
+ "time-macros",
1107
+]
1108
+
1109
+[[package]]
1110
+name = "time-core"
1111
+version = "0.1.1"
1112
+source = "registry+https://github.com/rust-lang/crates.io-index"
1113
+checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
1114
+
1115
+[[package]]
1116
+name = "time-macros"
1117
+version = "0.2.9"
1118
+source = "registry+https://github.com/rust-lang/crates.io-index"
1119
+checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b"
1120
+dependencies = [
1121
+ "time-core",
1122
+]
1123
+
1124
+[[package]]
1125
+name = "tinyvec"
1126
+version = "1.6.0"
1127
+source = "registry+https://github.com/rust-lang/crates.io-index"
1128
+checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
1129
+dependencies = [
1130
+ "tinyvec_macros",
1131
+]
1132
+
1133
+[[package]]
1134
+name = "tinyvec_macros"
1135
+version = "0.1.1"
1136
+source = "registry+https://github.com/rust-lang/crates.io-index"
1137
+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1138
+
1139
+[[package]]
1140
+name = "tracing"
1141
+version = "0.1.37"
1142
+source = "registry+https://github.com/rust-lang/crates.io-index"
1143
+checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
1144
+dependencies = [
1145
+ "cfg-if",
1146
+ "pin-project-lite",
1147
+ "tracing-attributes",
1148
+ "tracing-core",
1149
+]
1150
+
1151
+[[package]]
1152
+name = "tracing-attributes"
1153
+version = "0.1.25"
1154
+source = "registry+https://github.com/rust-lang/crates.io-index"
1155
+checksum = "8803eee176538f94ae9a14b55b2804eb7e1441f8210b1c31290b3bccdccff73b"
1156
+dependencies = [
1157
+ "proc-macro2",
1158
+ "quote",
1159
+ "syn 2.0.18",
1160
+]
1161
+
1162
+[[package]]
1163
+name = "tracing-core"
1164
+version = "0.1.31"
1165
+source = "registry+https://github.com/rust-lang/crates.io-index"
1166
+checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
1167
+dependencies = [
1168
+ "once_cell",
1169
+]
1170
+
1171
+[[package]]
1172
+name = "triomphe"
1173
+version = "0.1.8"
1174
+source = "registry+https://github.com/rust-lang/crates.io-index"
1175
+checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db"
1176
+dependencies = [
1177
+ "serde",
1178
+ "stable_deref_trait",
1179
+]
1180
+
1181
+[[package]]
1182
+name = "typed-arena"
1183
+version = "2.0.2"
1184
+source = "registry+https://github.com/rust-lang/crates.io-index"
1185
+checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
1186
+
1187
+[[package]]
1188
+name = "unicode-bidi"
1189
+version = "0.3.13"
1190
+source = "registry+https://github.com/rust-lang/crates.io-index"
1191
+checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
1192
+
1193
+[[package]]
1194
+name = "unicode-id"
1195
+version = "0.3.3"
1196
+source = "registry+https://github.com/rust-lang/crates.io-index"
1197
+checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a"
1198
+
1199
+[[package]]
1200
+name = "unicode-ident"
1201
+version = "1.0.9"
1202
+source = "registry+https://github.com/rust-lang/crates.io-index"
1203
+checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
1204
+
1205
+[[package]]
1206
+name = "unicode-normalization"
1207
+version = "0.1.22"
1208
+source = "registry+https://github.com/rust-lang/crates.io-index"
1209
+checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
1210
+dependencies = [
1211
+ "tinyvec",
1212
+]
1213
+
1214
+[[package]]
1215
+name = "unicode-width"
1216
+version = "0.1.10"
1217
+source = "registry+https://github.com/rust-lang/crates.io-index"
1218
+checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
1219
+
1220
+[[package]]
1221
+name = "url"
1222
+version = "2.4.0"
1223
+source = "registry+https://github.com/rust-lang/crates.io-index"
1224
+checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
1225
+dependencies = [
1226
+ "form_urlencoded",
1227
+ "idna",
1228
+ "percent-encoding",
1229
+]
1230
+
1231
+[[package]]
1232
+name = "vergen"
1233
+version = "7.5.1"
1234
+source = "registry+https://github.com/rust-lang/crates.io-index"
1235
+checksum = "f21b881cd6636ece9735721cf03c1fe1e774fe258683d084bb2812ab67435749"
1236
+dependencies = [
1237
+ "anyhow",
1238
+ "cfg-if",
1239
+ "enum-iterator",
1240
+ "getset",
1241
+ "rustversion",
1242
+ "thiserror",
1243
+ "time",
1244
+]
1245
+
1246
+[[package]]
1247
+name = "version_check"
1248
+version = "0.9.4"
1249
+source = "registry+https://github.com/rust-lang/crates.io-index"
1250
+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
1251
+
1252
+[[package]]
1253
+name = "wasi"
1254
+version = "0.11.0+wasi-snapshot-preview1"
1255
+source = "registry+https://github.com/rust-lang/crates.io-index"
1256
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
1257
+
1258
+[[package]]
1259
+name = "winapi"
1260
+version = "0.3.9"
1261
+source = "registry+https://github.com/rust-lang/crates.io-index"
1262
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1263
+dependencies = [
1264
+ "winapi-i686-pc-windows-gnu",
1265
+ "winapi-x86_64-pc-windows-gnu",
1266
+]
1267
+
1268
+[[package]]
1269
+name = "winapi-i686-pc-windows-gnu"
1270
+version = "0.4.0"
1271
+source = "registry+https://github.com/rust-lang/crates.io-index"
1272
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1273
+
1274
+[[package]]
1275
+name = "winapi-util"
1276
+version = "0.1.5"
1277
+source = "registry+https://github.com/rust-lang/crates.io-index"
1278
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1279
+dependencies = [
1280
+ "winapi",
1281
+]
1282
+
1283
+[[package]]
1284
+name = "winapi-x86_64-pc-windows-gnu"
1285
+version = "0.4.0"
1286
+source = "registry+https://github.com/rust-lang/crates.io-index"
1287
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1288
+
1289
+[[package]]
1290
+name = "windows-targets"
1291
+version = "0.48.0"
1292
+source = "registry+https://github.com/rust-lang/crates.io-index"
1293
+checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
1294
+dependencies = [
1295
+ "windows_aarch64_gnullvm",
1296
+ "windows_aarch64_msvc",
1297
+ "windows_i686_gnu",
1298
+ "windows_i686_msvc",
1299
+ "windows_x86_64_gnu",
1300
+ "windows_x86_64_gnullvm",
1301
+ "windows_x86_64_msvc",
1302
+]
1303
+
1304
+[[package]]
1305
+name = "windows_aarch64_gnullvm"
1306
+version = "0.48.0"
1307
+source = "registry+https://github.com/rust-lang/crates.io-index"
1308
+checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
1309
+
1310
+[[package]]
1311
+name = "windows_aarch64_msvc"
1312
+version = "0.48.0"
1313
+source = "registry+https://github.com/rust-lang/crates.io-index"
1314
+checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
1315
+
1316
+[[package]]
1317
+name = "windows_i686_gnu"
1318
+version = "0.48.0"
1319
+source = "registry+https://github.com/rust-lang/crates.io-index"
1320
+checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
1321
+
1322
+[[package]]
1323
+name = "windows_i686_msvc"
1324
+version = "0.48.0"
1325
+source = "registry+https://github.com/rust-lang/crates.io-index"
1326
+checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
1327
+
1328
+[[package]]
1329
+name = "windows_x86_64_gnu"
1330
+version = "0.48.0"
1331
+source = "registry+https://github.com/rust-lang/crates.io-index"
1332
+checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
1333
+
1334
+[[package]]
1335
+name = "windows_x86_64_gnullvm"
1336
+version = "0.48.0"
1337
+source = "registry+https://github.com/rust-lang/crates.io-index"
1338
+checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
1339
+
1340
+[[package]]
1341
+name = "windows_x86_64_msvc"
1342
+version = "0.48.0"
1343
+source = "registry+https://github.com/rust-lang/crates.io-index"
1344
+checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
compiler/forget/Cargo.toml
new
+7
@@ -0,0 +1,7 @@
1
+[workspace]
2
+
3
+members = [
4
+ "crates/swc-demo",
5
+ "crates/estree",
6
+ "crates/estree-swc",
7
+]
\ No newline at end of file
compiler/forget/crates/swc-demo/Cargo.toml
new
+14
@@ -0,0 +1,14 @@
1
+[package]
2
+name = "swc-demo"
3
+version = "0.1.0"
4
+edition = "2021"
5
+
6
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
+
8
+[dependencies]
9
+swc_common = { version = "0.31.12", features = ["tty-emitter", "sourcemap", "anyhow"] }
10
+swc_core = "0.78.15"
11
+swc_ecma_parser = "0.136.2"
12
+swc_ecma_transforms_base = "0.129.8"
13
+swc_ecma_visit = "0.92.1"
14
+swc_visit = "0.5.6"
compiler/forget/crates/swc-demo/src/main.rs
new
+59
@@ -0,0 +1,59 @@
1
+use swc_common::sync::Lrc;
2
+use swc_common::Mark;
3
+use swc_common::{
4
+ errors::{ColorConfig, Handler},
5
+ FileName, SourceMap,
6
+};
7
+use swc_ecma_parser::{lexer::Lexer, Parser, StringInput, Syntax};
8
+use swc_ecma_transforms_base::resolver;
9
+use swc_ecma_visit::swc_ecma_ast::Program;
10
+use swc_ecma_visit::VisitMutWith;
11
+
12
+fn main() {
13
+ let cm: Lrc<SourceMap> = Default::default();
14
+ let handler = Handler::with_tty_emitter(ColorConfig::Auto, true, false, Some(cm.clone()));
15
+
16
+ // Real usage
17
+ // let fm = cm
18
+ // .load_file(Path::new("test.js"))
19
+ // .expect("failed to load test.js");
20
+ let fm = cm.new_source_file(
21
+ FileName::Custom("test.js".into()),
22
+ "function foo(x: number, y: number): number { return x + y}".into(),
23
+ );
24
+ let lexer = Lexer::new(
25
+ // We want to parse ecmascript
26
+ Syntax::Typescript(swc_ecma_parser::TsConfig {
27
+ tsx: true,
28
+ decorators: true,
29
+ ..Default::default()
30
+ }),
31
+ // EsVersion defaults to es5
32
+ Default::default(),
33
+ StringInput::from(&*fm),
34
+ None,
35
+ );
36
+
37
+ let mut parser = Parser::new_from(lexer);
38
+
39
+ for e in parser.take_errors() {
40
+ e.into_diagnostic(&handler).emit();
41
+ }
42
+
43
+ let module = parser
44
+ .parse_module()
45
+ .map_err(|e| {
46
+ // Unrecoverable fatal error occurred
47
+ e.into_diagnostic(&handler).emit()
48
+ })
49
+ .expect("failed to parser module");
50
+
51
+ let mut module = Program::Module(module);
52
+
53
+ let _result = swc_common::GLOBALS.set(&swc_common::Globals::new(), || {
54
+ let mut resolved = resolver(Mark::new(), Mark::new(), true);
55
+ module.visit_mut_with(&mut resolved)
56
+ });
57
+
58
+ println!("{:#?}", module);
59
+}