-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
bootstrap.js
19531 lines (18239 loc) · 601 KB
/
bootstrap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Generated by Hexa 2023.7.2 https://hexalang.github.io
// Project: The Hexa Compiler
// LICENSE LGPL-3.0-only
;(() => {
"use strict"
const $global = typeof(window) === "undefined"? global : window
if (typeof($global.require) === "undefined") { $global.require = () => {} };
const selfVersion="2023.7.2";
const $toIterator = (v) => typeof(v) === "number"? Array(Math.max(v, 0)).keys() : v;
const Fs = require("fs")
const Path = require("path")
const ProcessModule = require("process")
var Token = {
stringify: (token, param = null) => { {
const temp = token;
switch (temp) {
case 70: {
return '@'
} break;
case 83: {
return '$'
} break;
case 78: {
return '#'
} break;
case 71: {
return ']'
} break;
case 72: {
return '['
} break;
case 73: {
return '}'
} break;
case 74: {
return '{'
} break;
case 76: {
return ':'
} break;
case 75: {
return ','
} break;
case 123: {
return '<!--empty-->'
} break;
case 77: {
return '.'
} break;
case 0: {
return '<!--end-->'
} break;
case 98: {
return '...'
} break;
case 58: {
return 'as'
} break;
case 3: {
return 'break'
} break;
case 4: {
return 'case'
} break;
case 6: {
return 'catch'
} break;
case 7: {
return 'class'
} break;
case 8: {
return 'continue'
} break;
case 9: {
return 'do'
} break;
case 10: {
return 'else'
} break;
case 11: {
return 'enum'
} break;
case 12: {
return 'extends'
} break;
case 13: {
return 'declare'
} break;
case 14: {
return 'false'
} break;
case 15: {
return 'for'
} break;
case 21: {
return 'fun'
} break;
case 17: {
return 'if'
} break;
case 18: {
return 'implements'
} break;
case 2: {
return 'import'
} break;
case 20: {
return 'in'
} break;
case 22: {
return 'interface'
} break;
case 23: {
return 'let'
} break;
case 25: {
return 'new'
} break;
case 26: {
return 'null'
} break;
case 29: {
return 'private'
} break;
case 31: {
return 'return'
} break;
case 32: {
return 'static'
} break;
case 59: {
return 'super'
} break;
case 33: {
return 'switch'
} break;
case 34: {
return 'this'
} break;
case 35: {
return 'throw'
} break;
case 36: {
return 'true'
} break;
case 37: {
return 'try'
} break;
case 40: {
return 'var'
} break;
case 41: {
return 'while'
} break;
case 111: {
return '+'
} break;
case 112: {
return '&'
} break;
case 90: {
return '=>'
} break;
case 91: {
return '='
} break;
case 92: {
return '&&'
} break;
case 93: {
return '||'
} break;
case 86: {
return '--'
} break;
case 94: {
return '/'
} break;
case 95: {
return '=='
} break;
case 96: {
return '>'
} break;
case 97: {
return '>='
} break;
case 87: {
return '++'
} break;
case 110: {
return '\\'
} break;
case 99: {
return '<'
} break;
case 100: {
return '<='
} break;
case 101: {
return '%'
} break;
case 102: {
return '*'
} break;
case 88: {
return '~'
} break;
case 89: {
return '!'
} break;
case 103: {
return '!='
} break;
case 104: {
return '|'
} break;
case 105: {
return '<<'
} break;
case 106: {
return '>>'
} break;
case 107: {
return '-'
} break;
case 108: {
return '>>>'
} break;
case 109: {
return '^'
} break;
case 113: {
return '?.'
} break;
case 79: {
return ')'
} break;
case 80: {
return '('
} break;
case 81: {
return '?'
} break;
case 82: {
return ';'
} break;
case 1: {
return '_'
} break;
case 61: {
return (((param == null))? ('TitleCase') : param)
} break;
case 64: {
return (((param == null))? ('string') : ('\'' + (param) + '\''))
} break;
case 66: {
return (((param == null))? ('backtick') : ('`' + (param) + '`'))
} break;
case 62: {
return (((param == null))? ('identifier') : param)
} break;
case 63: {
return (((param == null))? ('integer') : param)
} break;
case 60: {
return (((param == null))? ('float') : param)
} break;
case 65: {
return ('///' + (param) + '')
} break;
case 57: {
return 'is'
} break;
};
} },
}
var Meta = {
stringify: (kind) => { {
const temp_6640 = kind;
switch (temp_6640) {
case 0: {
return 'Default'
} break;
case 1: {
return 'BigInt'
} break;
case 2: {
return 'Int32'
} break;
case 3: {
return 'Int64'
} break;
case 4: {
return 'Int16'
} break;
case 5: {
return 'Int8'
} break;
case 6: {
return 'UInt32'
} break;
case 7: {
return 'UInt64'
} break;
case 8: {
return 'UInt16'
} break;
case 9: {
return 'UInt8'
} break;
case 10: {
return 'Float32'
} break;
};
} },
}
var Statement = {
}
var Expression = {
}
var NiceType = {
}
var ImportNode = {
}
var NodeType = {
stringify: (nodeType) => { {
{
const temp = nodeType;
switch (temp&&temp[0]) {
case 0: {
const type_6721 = temp[1];
return NodeType.stringify(type_6721) + '?'
} break;
case 5: {
const names_6722 = temp[1];
const types_6723 = temp[2];
{
if (names_6722.length == 0) { return '{}' };
return '{ ' + (() => {
const result = [];
const value_6724 = names_6722.length;
for (const i of $toIterator(value_6724)) result.push(names_6722[i] + ': ' + NodeType.stringify(types_6723[i]));
return result;
})().join(', ') + ' }';
}
} break;
case 3: {
const args_6725 = temp[1];
const ret_6726 = temp[2];
return '(' + args_6725.map((arg) => (NodeType.stringify(arg))).join(', ') + ') => ' + NodeType.stringify(ret_6726)
} break;
};
};
return DataHelper.extractTypeName(nodeType);
} },
clone: (nodeType_6727) => { {
{
const temp_6728 = nodeType_6727;
switch (temp_6728&&temp_6728[0]) {
case 1: {
const name_6729 = temp_6728[1];
const path_6730 = temp_6728[2];
return /*Type*/[1,name_6729,path_6730,".Type"]
} break;
case 2: {
const name_6731 = temp_6728[1];
const params_6732 = temp_6728[2];
const path_6733 = temp_6728[3];
return /*ParametricType*/[2,name_6731,params_6732.map((param) => (NodeType.clone(param))),path_6733,".ParametricType"]
} break;
};
};
console.error('Cannot clone node type', nodeType_6727);
return nodeType_6727;
} },
}
var Node = {
stringify: (node) => { {
const temp = node;
switch (temp&&temp[0]) {
case 0: {
const s = temp[1];
return ('\'' + (s) + '\'')
} break;
case 1: {
const name_6779 = temp[1];
return name_6779
} break;
case 2: {
const b = temp[1];
return ((b)? ('true') : 'false')
} break;
case 5: {
const s_6780 = temp[1];
return s_6780.toString(10)
} break;
case 7: {
const s_6781 = temp[1];
return s_6781.toString(10)
} break;
case 8: {
return 'null'
} break;
case 3: {
return 'this'
} break;
case 15: {
const expr_6782 = temp[1];
return '(' + Node.stringify(expr_6782) + ')'
} break;
case 33: {
const expr_6783 = temp[1];
const index_6784 = temp[2];
return Node.stringify(expr_6783) + '[' + Node.stringify(index_6784) + ']'
} break;
case 28: {
const expr_6785 = temp[1];
const name_6786 = temp[2];
return Node.stringify(expr_6785) + '.' + name_6786
} break;
case 29: {
const expr_6787 = temp[1];
const name_6788 = temp[2];
return Node.stringify(expr_6787) + '.' + name_6788
} break;
case 13: {
const e_6789 = temp[1];
const args_6790 = temp[2];
const argNames_6791 = temp[3];
{
const arg = [];
{
let i = 0;
let it = 0;
let at = args_6790.length;
while (it < at) {
i = it;
it++;
{
let step = 0;
const name_6792 = argNames_6791[i];
if (step == 0 && name_6792 != null) { step = 1 };
if (step == 1) { arg.push(name_6792 + ': ' + Node.stringify(args_6790[i])) } else {
arg.push(Node.stringify(args_6790[i]));
};
};
};
};
return Node.stringify(e_6789) + '(' + arg.join(', ') + ')';
}
} break;
case 31: {
const elements_6793 = temp[1];
return '[' + (() => {
const result = [];
const value_6794 = elements_6793;
for (const el of $toIterator(value_6794)) result.push(Node.stringify(el));
return result;
})().join(', ') + ']'
} break;
case 10: {
const a = temp[1];
const op_6795 = temp[2];
const b_6796 = temp[3];
return Node.stringify(a) + ' ' + Token.stringify(op_6795) + ' ' + Node.stringify(b_6796)
} break;
case 38: {
const names_6797 = temp[1];
const el_6798 = temp[2];
return '{' + (() => {
const result_6799 = [];
const value_6800 = el_6798.length;
for (const i of $toIterator(value_6800)) result_6799.push(names_6797[i] + ': ' + Node.stringify(el_6798[i]));
return result_6799;
})().join(', ') + '}'
} break;
case 51: {
const t_6801 = temp[1];
return DataHelper.extractTypeName(t_6801)
} break;
case 47: {
const f = temp[1];
return 'static ' + Node.stringify(f)
} break;
default:
{
console.error('stringify', node);
return '...';
}
};
} },
clone: (project, node_6802) => { {
const p = project;
{
const temp_6803 = node_6802;
switch (temp_6803&&temp_6803[0]) {
case 0: {
const s_6804 = temp_6803[1];
return Node.cloneData(p, node_6802, /*String*/[0,s_6804,".String"])
} break;
case 1: {
const name_6805 = temp_6803[1];
const params_6806 = temp_6803[2];
{
{
let step_6807 = 0;
const params_6808 = params_6806;
if (step_6807 == 0 && params_6808 != null) { step_6807 = 1 };
if (step_6807 == 1) { return Node.cloneData(p, node_6802, /*Ident*/[1,name_6805,params_6808.map((param) => (NodeType.clone(param))),".Ident"]) };
};
return Node.cloneData(p, node_6802, /*Ident*/[1,name_6805,null,".Ident"]);
}
} break;
case 2: {
const b_6809 = temp_6803[1];
return Node.cloneData(p, node_6802, /*Bool*/[2,b_6809,".Bool"])
} break;
case 5: {
const s_6810 = temp_6803[1];
return Node.cloneData(p, node_6802, /*Int*/[5,s_6810,".Int"])
} break;
case 6: {
const number_6811 = temp_6803[1];
const meta_6812 = temp_6803[2];
return Node.cloneData(p, node_6802, /*MetaInt*/[6,number_6811,meta_6812,".MetaInt"])
} break;
case 7: {
const s_6813 = temp_6803[1];
const meta_6814 = temp_6803[2];
return Node.cloneData(p, node_6802, /*Float*/[7,s_6813,meta_6814,".Float"])
} break;
case 8: {
return Node.cloneData(p, node_6802, /*Null*/[8,".Null"])
} break;
case 3: {
return Node.cloneData(p, node_6802, /*This*/[3,".This"])
} break;
case 15: {
const expr_6815 = temp_6803[1];
return Node.cloneData(p, node_6802, /*Parenthesis*/[15,Node.cloneData(p, expr_6815, Node.clone(p, expr_6815)),".Parenthesis"])
} break;
case 33: {
const expr_6816 = temp_6803[1];
const index_6817 = temp_6803[2];
return Node.cloneData(p, node_6802, /*Index*/[33,Node.cloneData(p, expr_6816, Node.clone(p, expr_6816)),Node.cloneData(p, index_6817, Node.clone(p, index_6817)),".Index"])
} break;
case 28: {
const expr_6818 = temp_6803[1];
const name_6819 = temp_6803[2];
return Node.cloneData(p, node_6802, /*Dot*/[28,Node.cloneData(p, expr_6818, Node.clone(p, expr_6818)),name_6819,".Dot"])
} break;
case 29: {
const expr_6820 = temp_6803[1];
const name_6821 = temp_6803[2];
return Node.cloneData(p, node_6802, /*DotUpper*/[29,Node.cloneData(p, expr_6820, Node.clone(p, expr_6820)),name_6821,".DotUpper"])
} break;
case 13: {
const e_6822 = temp_6803[1];
const args_6823 = temp_6803[2];
const argNames_6824 = temp_6803[3];
return Node.cloneData(p, node_6802, /*Call*/[13,Node.cloneData(p, e_6822, Node.clone(p, e_6822)),args_6823.map((arg_6825) => (Node.cloneData(p, arg_6825, Node.clone(p, arg_6825)))),argNames_6824,".Call"])
} break;
case 31: {
const elements_6826 = temp_6803[1];
return Node.cloneData(p, node_6802, /*Array*/[31,elements_6826.map((arg_6827) => (Node.cloneData(p, arg_6827, Node.clone(p, arg_6827)))),".Array"])
} break;
case 10: {
const a_6828 = temp_6803[1];
const op_6829 = temp_6803[2];
const b_6830 = temp_6803[3];
return Node.cloneData(p, node_6802, /*Binop*/[10,Node.cloneData(p, a_6828, Node.clone(p, a_6828)),op_6829,Node.cloneData(p, b_6830, Node.clone(p, b_6830)),".Binop"])
} break;
case 11: {
const storage_6831 = temp_6803[1];
const op_6832 = temp_6803[2];
const value_6833 = temp_6803[3];
return Node.cloneData(p, node_6802, /*AssignOp*/[11,Node.cloneData(p, storage_6831, Node.clone(p, storage_6831)),op_6832,Node.cloneData(p, value_6833, Node.clone(p, value_6833)),".AssignOp"])
} break;
case 49: {
const name_6834 = temp_6803[1];
const over_6835 = temp_6803[2];
const by_6836 = temp_6803[3];
const range_6837 = temp_6803[4];
return Node.cloneData(p, node_6802, /*For*/[49,name_6834,Node.cloneData(p, over_6835, Node.clone(p, over_6835)),Node.cloneData(p, by_6836, Node.clone(p, by_6836)),Node.cloneData(p, range_6837, Node.clone(p, range_6837)),".For"])
} break;
case 21: {
const reason_6838 = temp_6803[1];
const e_6839 = temp_6803[2];
const pre_6840 = temp_6803[3];
return Node.cloneData(p, node_6802, /*While*/[21,Node.cloneData(p, reason_6838, Node.clone(p, reason_6838)),Node.cloneData(p, e_6839, Node.clone(p, e_6839)),pre_6840,".While"])
} break;
case 34: {
const exprs_6841 = temp_6803[1];
const conds_6842 = temp_6803[2];
const guards_6843 = temp_6803[3];
const cases_6844 = temp_6803[4];
return Node.cloneData(p, node_6802, /*Switch*/[34,exprs_6841.map((arg_6845) => (Node.cloneData(p, arg_6845, Node.clone(p, arg_6845)))),conds_6842.map((arg_6846) => (Node.cloneData(p, arg_6846, Node.clone(p, arg_6846)))),guards_6843.map((arg_6847) => (Node.cloneData(p, arg_6847, Node.clone(p, arg_6847)))),cases_6844.map((arg_6848) => (Node.cloneData(p, arg_6848, Node.clone(p, arg_6848)))),".Switch"])
} break;
case 38: {
const names_6849 = temp_6803[1];
const el_6850 = temp_6803[2];
return Node.cloneData(p, node_6802, /*Object*/[38,names_6849,el_6850.map((arg_6851) => (Node.cloneData(p, arg_6851, Node.clone(p, arg_6851)))),".Object"])
} break;
case 51: {
const t_6852 = temp_6803[1];
return Node.cloneData(p, node_6802, /*NodeTypeValue*/[51,t_6852,".NodeTypeValue"])
} break;
case 44: {
const expr_6853 = temp_6803[1];
const kind_6854 = temp_6803[2];
const toType_6855 = temp_6803[3];
return Node.cloneData(p, node_6802, /*As*/[44,Node.cloneData(p, expr_6853, Node.clone(p, expr_6853)),kind_6854,NodeType.clone(toType_6855),".As"])
} break;
case 30: {
const path_6856 = temp_6803[1];
const t_6857 = temp_6803[2];
const args_6858 = temp_6803[3];
const fields_6859 = temp_6803[4];
const el_6860 = temp_6803[5];
const argNames_6861 = temp_6803[6];
return Node.cloneData(p, node_6802, /*New*/[30,path_6856,t_6857,args_6858.map((arg_6862) => (Node.cloneData(p, arg_6862, Node.clone(p, arg_6862)))),fields_6859,el_6860.map((arg_6863) => (Node.cloneData(p, arg_6863, Node.clone(p, arg_6863)))),argNames_6861,".New"])
} break;
case 20: {
const op_6864 = temp_6803[1];
const postfix_6865 = temp_6803[2];
const e_6866 = temp_6803[3];
return Node.cloneData(p, node_6802, /*Unop*/[20,op_6864,postfix_6865,Node.cloneData(p, e_6866, Node.clone(p, e_6866)),".Unop"])
} break;
case 23: {
const expr_6867 = temp_6803[1];
const vars_6868 = temp_6803[2];
const retType_6869 = temp_6803[3];
return Node.cloneData(p, node_6802, /*Arrow*/[23,Node.cloneData(p, expr_6867, Node.clone(p, expr_6867)),vars_6868.map((arg_6870) => (Node.cloneData(p, arg_6870, Node.clone(p, arg_6870)))),retType_6869,".Arrow"])
} break;
case 47: {
const f_6871 = temp_6803[1];
return Node.cloneData(p, node_6802, /*Static*/[47,Node.cloneData(p, f_6871, Node.clone(p, f_6871)),".Static"])
} break;
case 16: {
const e_6872 = temp_6803[1];
{
{
let step_6873 = 0;
const e_6874 = e_6872;
if (step_6873 == 0 && e_6874 != null) { step_6873 = 1 };
if (step_6873 == 1) { return Node.cloneData(p, node_6802, /*Return*/[16,Node.cloneData(p, e_6874, Node.clone(p, e_6874)),".Return"]) };
};
return Node.cloneData(p, node_6802, /*Return*/[16,null,".Return"]);
}
} break;
case 12: {
const el_6875 = temp_6803[1];
return Node.cloneData(p, node_6802, /*Block*/[12,el_6875.map((arg_6876) => (Node.cloneData(p, arg_6876, Node.clone(p, arg_6876)))),".Block"])
} break;
case 14: {
const econd_6877 = temp_6803[1];
const eif_6878 = temp_6803[2];
const eelse_6879 = temp_6803[3];
const ternary_6880 = temp_6803[4];
return Node.cloneData(p, node_6802, /*If*/[14,econd_6877.map((arg_6881) => (Node.cloneData(p, arg_6881, Node.clone(p, arg_6881)))),Node.cloneData(p, eif_6878, Node.clone(p, eif_6878)),((eelse_6879 != null)? (Node.cloneData(p, eelse_6879, Node.clone(p, eelse_6879))) : null),ternary_6880,".If"])
} break;
case 24: {
const name_6882 = temp_6803[1];
const t_6883 = temp_6803[2];
const expr_6884 = temp_6803[3];
const const_6885 = temp_6803[4];
const external_6886 = temp_6803[5];
return Node.cloneData(p, node_6802, /*Var*/[24,name_6882,t_6883,Node.cloneData(p, expr_6884, Node.clone(p, expr_6884)),const_6885,external_6886,".Var"])
} break;
case 22: {
const name_6887 = temp_6803[1];
const body_6888 = temp_6803[2];
const vars_6889 = temp_6803[3];
const retType_6890 = temp_6803[4];
const external_6891 = temp_6803[5];
const variadic_6892 = temp_6803[6];
return Node.cloneData(p, node_6802, /*Function*/[22,name_6887,Node.cloneData(p, body_6888, Node.clone(p, body_6888)),vars_6889.map((arg_6893) => (Node.cloneData(p, arg_6893, Node.clone(p, arg_6893)))),retType_6890,external_6891,variadic_6892,".Function"])
} break;
case 25: {
const t_6894 = temp_6803[1];
const extend_6895 = temp_6803[2];
const implement_6896 = temp_6803[3];
const fields_6897 = temp_6803[4];
const external_6898 = temp_6803[5];
const kind_6899 = temp_6803[6];
{
for (const field of $toIterator(fields_6897)) {
if ((project.data.get(field) == null) && (Node.fails < 15)) { Node.fails++ };
};
return Node.cloneData(p, node_6802, /*Class*/[25,t_6894,extend_6895,implement_6896,fields_6897.map((arg_6900) => (Node.cloneData(p, arg_6900, Node.clone(p, arg_6900)))),external_6898,kind_6899,".Class"]);
}
} break;
case 45: {
return Node.cloneData(p, node_6802, /*Underscore*/[45,".Underscore"])
} break;
case 18: {
return Node.cloneData(p, node_6802, /*Break*/[18,".Break"])
} break;
case 19: {
return Node.cloneData(p, node_6802, /*Continue*/[19,".Continue"])
} break;
case null: case undefined: {
return null
} break;
default:
{
}
};
};
console.log('Cannot clone', node_6802);
return node_6802;
} },
cloneData: (project_6901, from, to) => { {
if (from == null) { return to };
const project_6902 = (project_6901);
if ((project_6902.data.get(from) == null) && (Node.fails < 10)) { Node.fails++ };
project_6902.mapDecorators.set(to, project_6902.mapDecorators.get(from));
project_6902.data.set(to, project_6902.data.get(from));
return to;
} },
}
Node.fails = 0
var Type = {
stringify: (type_6940) => { {
const temp = type_6940;
switch (temp&&temp[0]) {
case 6: {
const type_6941 = temp[1];
const generic_6942 = temp[2];
{
{
let step = 0;
const gen = generic_6942;
if (step == 0 && gen != null) { step = 1 };
if (step == 1) { return DataHelper.nameOf(type_6941.parent) + '<' + (() => {
const result = [];
const value_6943 = gen;
for (const g of $toIterator(value_6943)) result.push(Type.stringify(g));
return result;
})().join(', ') + '>' };
};
return DataHelper.nameOf(type_6941.parent);
}
} break;
case 1: {
const index_6944 = temp[1];
const name_6945 = temp[2];
return '<' + name_6945 + ' at ' + index_6944 + '>'
} break;
case 5: {
const type_6946 = temp[1];
return DataHelper.nameOf(type_6946.parent)
} break;
case 12: {
const args_6947 = temp[1];
const returns_6948 = temp[2];
return '(' + (() => {
const result_6949 = [];
const value_6950 = args_6947;
for (const arg of $toIterator(value_6950)) result_6949.push(Type.stringify(arg.type));
return result_6949;
})().join(', ') + ') => ' + Type.stringify(returns_6948)
} break;
case 3: {
const handle_6951 = temp[1];
{
{
let step_6952 = 0;
const value_6953 = handle_6951.value;
if (step_6952 == 0 && value_6953 != null) { step_6952 = 1 };
if (step_6952 == 1) { return Type.stringify(value_6953) + '?' };
};
return 'Unknown?';
}
} break;
case 4: {
const type_6954 = temp[1];
return Type.stringify(type_6954) + '?'
} break;
case 8: {
const type_6955 = temp[1];
return DataHelper.nameOf(type_6955.parent)
} break;
case 9: {
const type_6956 = temp[1];
const tag_6957 = temp[2];
{
const tagName = type_6956.fieldNames[tag_6957];
return DataHelper.nameOf(type_6956.parent) + '.' + tagName;
}
} break;
case 2: {
const handle_6958 = temp[1];
{
{
let step_6959 = 0;
const value_6960 = handle_6958.value;
if (step_6959 == 0 && value_6960 != null) { step_6959 = 1 };
if (step_6959 == 1) { return Type.stringify(value_6960) };
};
return 'Unknown';
}
} break;
case 11: {
const alias_6961 = temp[1];
return NodeType.stringify(alias_6961.value)
} break;
case 0: {
const value_6962 = temp[1];
return value_6962
} break;
case 13: {
const names_6963 = temp[1];
const types_6964 = temp[2];
return '{ ' + (() => {
const result_6965 = [];
const value_6966 = names_6963.length;
for (const i of $toIterator(value_6966)) result_6965.push(names_6963[i] + Type.stringify(types_6964[i]));
return result_6965;
})().join(', ') + ' }'
} break;
case null: case undefined: {
return 'could not infer type, try to set type manually'
} break;
default:
return '~?' + type_6940 + '?~'
};
} },
primaryName: (type_6967) => { {
const temp_6968 = type_6967;
switch (temp_6968&&temp_6968[0]) {
case 5: {
const type_6969 = temp_6968[1];
return type_6969.name
} break;