@ant-yasa/uast-parser-php 0.2.10 → 0.2.11

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 (35) hide show
  1. package/dist/package.json +0 -1
  2. package/dist/src/parser.js +147 -11
  3. package/dist/src/parser.js.map +1 -1
  4. package/package.json +1 -2
  5. package/src/index.ts +0 -26
  6. package/src/parser.ts +0 -1234
  7. package/tests/benchmark/base/advanced.php +0 -20
  8. package/tests/benchmark/base/advanced.php.json +0 -1269
  9. package/tests/benchmark/base/basic.php +0 -3
  10. package/tests/benchmark/base/basic.php.json +0 -292
  11. package/tests/benchmark/base/closure-class.php +0 -24
  12. package/tests/benchmark/base/closure-class.php.json +0 -1623
  13. package/tests/benchmark/base/control-flow.php +0 -37
  14. package/tests/benchmark/base/control-flow.php.json +0 -2010
  15. package/tests/benchmark/base/enum-trait-adapt.php +0 -31
  16. package/tests/benchmark/base/enum-trait-adapt.php.json +0 -965
  17. package/tests/benchmark/base/exprs.php +0 -4
  18. package/tests/benchmark/base/exprs.php.json +0 -811
  19. package/tests/benchmark/base/flow-extras.php +0 -12
  20. package/tests/benchmark/base/flow-extras.php.json +0 -897
  21. package/tests/benchmark/base/function.php +0 -7
  22. package/tests/benchmark/base/function.php.json +0 -536
  23. package/tests/benchmark/base/modern-php.php +0 -13
  24. package/tests/benchmark/base/modern-php.php.json +0 -508
  25. package/tests/benchmark/base/namespace.php +0 -5
  26. package/tests/benchmark/base/namespace.php.json +0 -307
  27. package/tests/benchmark/base/new-static.php +0 -3
  28. package/tests/benchmark/base/new-static.php.json +0 -399
  29. package/tests/benchmark/base/runtime.php +0 -13
  30. package/tests/benchmark/base/runtime.php.json +0 -1095
  31. package/tests/benchmark/base/strings-casts.php +0 -17
  32. package/tests/benchmark/base/strings-casts.php.json +0 -1357
  33. package/tests/benchmark/base/structures.php +0 -26
  34. package/tests/benchmark/base/structures.php.json +0 -1582
  35. package/tests/index.ts +0 -87
@@ -1,965 +0,0 @@
1
- {
2
- "type": "CompileUnit",
3
- "body": [
4
- {
5
- "type": "ClassDefinition",
6
- "id": {
7
- "type": "Identifier",
8
- "name": "LoggerA",
9
- "_meta": {
10
- "loc": {
11
- "start": {
12
- "line": 3,
13
- "column": 7
14
- },
15
- "end": {
16
- "line": 3,
17
- "column": 14
18
- },
19
- "sourcefile": "enum-trait-adapt.php"
20
- }
21
- },
22
- "loc": {
23
- "start": {
24
- "line": 3,
25
- "column": 7
26
- },
27
- "end": {
28
- "line": 3,
29
- "column": 14
30
- },
31
- "sourcefile": "enum-trait-adapt.php"
32
- }
33
- },
34
- "body": [
35
- {
36
- "type": "FunctionDefinition",
37
- "id": {
38
- "type": "Identifier",
39
- "name": "log",
40
- "_meta": {
41
- "loc": {
42
- "start": {
43
- "line": 5,
44
- "column": 21
45
- },
46
- "end": {
47
- "line": 5,
48
- "column": 24
49
- },
50
- "sourcefile": "enum-trait-adapt.php"
51
- }
52
- },
53
- "loc": {
54
- "start": {
55
- "line": 5,
56
- "column": 21
57
- },
58
- "end": {
59
- "line": 5,
60
- "column": 24
61
- },
62
- "sourcefile": "enum-trait-adapt.php"
63
- }
64
- },
65
- "parameters": [],
66
- "returnType": {
67
- "type": "DynamicType",
68
- "id": null,
69
- "_meta": {}
70
- },
71
- "body": {
72
- "type": "ScopedStatement",
73
- "body": [
74
- {
75
- "type": "ExpressionStatement",
76
- "expression": {
77
- "type": "CallExpression",
78
- "callee": {
79
- "type": "Identifier",
80
- "name": "echo",
81
- "_meta": {}
82
- },
83
- "arguments": [
84
- {
85
- "type": "Literal",
86
- "value": "A",
87
- "literalType": "string",
88
- "_meta": {
89
- "loc": {
90
- "start": {
91
- "line": 7,
92
- "column": 14
93
- },
94
- "end": {
95
- "line": 7,
96
- "column": 17
97
- },
98
- "sourcefile": "enum-trait-adapt.php"
99
- },
100
- "encapsed": true
101
- },
102
- "loc": {
103
- "start": {
104
- "line": 7,
105
- "column": 14
106
- },
107
- "end": {
108
- "line": 7,
109
- "column": 17
110
- },
111
- "sourcefile": "enum-trait-adapt.php"
112
- }
113
- }
114
- ],
115
- "_meta": {
116
- "loc": {
117
- "start": {
118
- "line": 7,
119
- "column": 9
120
- },
121
- "end": {
122
- "line": 7,
123
- "column": 18
124
- },
125
- "sourcefile": "enum-trait-adapt.php"
126
- }
127
- },
128
- "loc": {
129
- "start": {
130
- "line": 7,
131
- "column": 9
132
- },
133
- "end": {
134
- "line": 7,
135
- "column": 18
136
- },
137
- "sourcefile": "enum-trait-adapt.php"
138
- }
139
- },
140
- "_meta": {
141
- "loc": {
142
- "start": {
143
- "line": 7,
144
- "column": 9
145
- },
146
- "end": {
147
- "line": 7,
148
- "column": 18
149
- },
150
- "sourcefile": "enum-trait-adapt.php"
151
- }
152
- },
153
- "loc": {
154
- "start": {
155
- "line": 7,
156
- "column": 9
157
- },
158
- "end": {
159
- "line": 7,
160
- "column": 18
161
- },
162
- "sourcefile": "enum-trait-adapt.php"
163
- }
164
- }
165
- ],
166
- "id": null,
167
- "_meta": {
168
- "loc": {
169
- "start": {
170
- "line": 6,
171
- "column": 5
172
- },
173
- "end": {
174
- "line": 8,
175
- "column": 6
176
- },
177
- "sourcefile": "enum-trait-adapt.php"
178
- }
179
- },
180
- "loc": {
181
- "start": {
182
- "line": 6,
183
- "column": 5
184
- },
185
- "end": {
186
- "line": 8,
187
- "column": 6
188
- },
189
- "sourcefile": "enum-trait-adapt.php"
190
- }
191
- },
192
- "modifiers": [
193
- "public"
194
- ],
195
- "_meta": {
196
- "loc": {
197
- "start": {
198
- "line": 5,
199
- "column": 5
200
- },
201
- "end": {
202
- "line": 8,
203
- "column": 6
204
- },
205
- "sourcefile": "enum-trait-adapt.php"
206
- }
207
- },
208
- "loc": {
209
- "start": {
210
- "line": 5,
211
- "column": 5
212
- },
213
- "end": {
214
- "line": 8,
215
- "column": 6
216
- },
217
- "sourcefile": "enum-trait-adapt.php"
218
- }
219
- }
220
- ],
221
- "supers": [],
222
- "_meta": {
223
- "kind": "trait",
224
- "loc": {
225
- "start": {
226
- "line": 3,
227
- "column": 1
228
- },
229
- "end": {
230
- "line": 9,
231
- "column": 2
232
- },
233
- "sourcefile": "enum-trait-adapt.php"
234
- }
235
- },
236
- "loc": {
237
- "start": {
238
- "line": 3,
239
- "column": 1
240
- },
241
- "end": {
242
- "line": 9,
243
- "column": 2
244
- },
245
- "sourcefile": "enum-trait-adapt.php"
246
- }
247
- },
248
- {
249
- "type": "ClassDefinition",
250
- "id": {
251
- "type": "Identifier",
252
- "name": "LoggerB",
253
- "_meta": {
254
- "loc": {
255
- "start": {
256
- "line": 11,
257
- "column": 7
258
- },
259
- "end": {
260
- "line": 11,
261
- "column": 14
262
- },
263
- "sourcefile": "enum-trait-adapt.php"
264
- }
265
- },
266
- "loc": {
267
- "start": {
268
- "line": 11,
269
- "column": 7
270
- },
271
- "end": {
272
- "line": 11,
273
- "column": 14
274
- },
275
- "sourcefile": "enum-trait-adapt.php"
276
- }
277
- },
278
- "body": [
279
- {
280
- "type": "FunctionDefinition",
281
- "id": {
282
- "type": "Identifier",
283
- "name": "log",
284
- "_meta": {
285
- "loc": {
286
- "start": {
287
- "line": 13,
288
- "column": 21
289
- },
290
- "end": {
291
- "line": 13,
292
- "column": 24
293
- },
294
- "sourcefile": "enum-trait-adapt.php"
295
- }
296
- },
297
- "loc": {
298
- "start": {
299
- "line": 13,
300
- "column": 21
301
- },
302
- "end": {
303
- "line": 13,
304
- "column": 24
305
- },
306
- "sourcefile": "enum-trait-adapt.php"
307
- }
308
- },
309
- "parameters": [],
310
- "returnType": {
311
- "type": "DynamicType",
312
- "id": null,
313
- "_meta": {}
314
- },
315
- "body": {
316
- "type": "ScopedStatement",
317
- "body": [
318
- {
319
- "type": "ExpressionStatement",
320
- "expression": {
321
- "type": "CallExpression",
322
- "callee": {
323
- "type": "Identifier",
324
- "name": "echo",
325
- "_meta": {}
326
- },
327
- "arguments": [
328
- {
329
- "type": "Literal",
330
- "value": "B",
331
- "literalType": "string",
332
- "_meta": {
333
- "loc": {
334
- "start": {
335
- "line": 15,
336
- "column": 14
337
- },
338
- "end": {
339
- "line": 15,
340
- "column": 17
341
- },
342
- "sourcefile": "enum-trait-adapt.php"
343
- },
344
- "encapsed": true
345
- },
346
- "loc": {
347
- "start": {
348
- "line": 15,
349
- "column": 14
350
- },
351
- "end": {
352
- "line": 15,
353
- "column": 17
354
- },
355
- "sourcefile": "enum-trait-adapt.php"
356
- }
357
- }
358
- ],
359
- "_meta": {
360
- "loc": {
361
- "start": {
362
- "line": 15,
363
- "column": 9
364
- },
365
- "end": {
366
- "line": 15,
367
- "column": 18
368
- },
369
- "sourcefile": "enum-trait-adapt.php"
370
- }
371
- },
372
- "loc": {
373
- "start": {
374
- "line": 15,
375
- "column": 9
376
- },
377
- "end": {
378
- "line": 15,
379
- "column": 18
380
- },
381
- "sourcefile": "enum-trait-adapt.php"
382
- }
383
- },
384
- "_meta": {
385
- "loc": {
386
- "start": {
387
- "line": 15,
388
- "column": 9
389
- },
390
- "end": {
391
- "line": 15,
392
- "column": 18
393
- },
394
- "sourcefile": "enum-trait-adapt.php"
395
- }
396
- },
397
- "loc": {
398
- "start": {
399
- "line": 15,
400
- "column": 9
401
- },
402
- "end": {
403
- "line": 15,
404
- "column": 18
405
- },
406
- "sourcefile": "enum-trait-adapt.php"
407
- }
408
- }
409
- ],
410
- "id": null,
411
- "_meta": {
412
- "loc": {
413
- "start": {
414
- "line": 14,
415
- "column": 5
416
- },
417
- "end": {
418
- "line": 16,
419
- "column": 6
420
- },
421
- "sourcefile": "enum-trait-adapt.php"
422
- }
423
- },
424
- "loc": {
425
- "start": {
426
- "line": 14,
427
- "column": 5
428
- },
429
- "end": {
430
- "line": 16,
431
- "column": 6
432
- },
433
- "sourcefile": "enum-trait-adapt.php"
434
- }
435
- },
436
- "modifiers": [
437
- "public"
438
- ],
439
- "_meta": {
440
- "loc": {
441
- "start": {
442
- "line": 13,
443
- "column": 5
444
- },
445
- "end": {
446
- "line": 16,
447
- "column": 6
448
- },
449
- "sourcefile": "enum-trait-adapt.php"
450
- }
451
- },
452
- "loc": {
453
- "start": {
454
- "line": 13,
455
- "column": 5
456
- },
457
- "end": {
458
- "line": 16,
459
- "column": 6
460
- },
461
- "sourcefile": "enum-trait-adapt.php"
462
- }
463
- }
464
- ],
465
- "supers": [],
466
- "_meta": {
467
- "kind": "trait",
468
- "loc": {
469
- "start": {
470
- "line": 11,
471
- "column": 1
472
- },
473
- "end": {
474
- "line": 17,
475
- "column": 2
476
- },
477
- "sourcefile": "enum-trait-adapt.php"
478
- }
479
- },
480
- "loc": {
481
- "start": {
482
- "line": 11,
483
- "column": 1
484
- },
485
- "end": {
486
- "line": 17,
487
- "column": 2
488
- },
489
- "sourcefile": "enum-trait-adapt.php"
490
- }
491
- },
492
- {
493
- "type": "ClassDefinition",
494
- "id": {
495
- "type": "Identifier",
496
- "name": "Service",
497
- "_meta": {
498
- "loc": {
499
- "start": {
500
- "line": 19,
501
- "column": 7
502
- },
503
- "end": {
504
- "line": 19,
505
- "column": 14
506
- },
507
- "sourcefile": "enum-trait-adapt.php"
508
- }
509
- },
510
- "loc": {
511
- "start": {
512
- "line": 19,
513
- "column": 7
514
- },
515
- "end": {
516
- "line": 19,
517
- "column": 14
518
- },
519
- "sourcefile": "enum-trait-adapt.php"
520
- }
521
- },
522
- "body": [
523
- {
524
- "type": "ExpressionStatement",
525
- "expression": {
526
- "type": "CallExpression",
527
- "callee": {
528
- "type": "Identifier",
529
- "name": "trait_use",
530
- "_meta": {}
531
- },
532
- "arguments": [
533
- {
534
- "type": "Identifier",
535
- "name": "LoggerA",
536
- "_meta": {
537
- "loc": {
538
- "start": {
539
- "line": 21,
540
- "column": 9
541
- },
542
- "end": {
543
- "line": 21,
544
- "column": 16
545
- },
546
- "sourcefile": "enum-trait-adapt.php"
547
- }
548
- },
549
- "loc": {
550
- "start": {
551
- "line": 21,
552
- "column": 9
553
- },
554
- "end": {
555
- "line": 21,
556
- "column": 16
557
- },
558
- "sourcefile": "enum-trait-adapt.php"
559
- }
560
- },
561
- {
562
- "type": "Identifier",
563
- "name": "LoggerB",
564
- "_meta": {
565
- "loc": {
566
- "start": {
567
- "line": 21,
568
- "column": 18
569
- },
570
- "end": {
571
- "line": 21,
572
- "column": 25
573
- },
574
- "sourcefile": "enum-trait-adapt.php"
575
- }
576
- },
577
- "loc": {
578
- "start": {
579
- "line": 21,
580
- "column": 18
581
- },
582
- "end": {
583
- "line": 21,
584
- "column": 25
585
- },
586
- "sourcefile": "enum-trait-adapt.php"
587
- }
588
- },
589
- {
590
- "type": "Noop",
591
- "_meta": {
592
- "loc": {
593
- "start": {
594
- "line": 21,
595
- "column": 26
596
- },
597
- "end": {
598
- "line": 24,
599
- "column": 6
600
- },
601
- "sourcefile": "enum-trait-adapt.php"
602
- }
603
- },
604
- "loc": {
605
- "start": {
606
- "line": 21,
607
- "column": 26
608
- },
609
- "end": {
610
- "line": 24,
611
- "column": 6
612
- },
613
- "sourcefile": "enum-trait-adapt.php"
614
- }
615
- }
616
- ],
617
- "_meta": {
618
- "synthetic": true,
619
- "loc": {
620
- "start": {
621
- "line": 21,
622
- "column": 5
623
- },
624
- "end": {
625
- "line": 24,
626
- "column": 6
627
- },
628
- "sourcefile": "enum-trait-adapt.php"
629
- }
630
- },
631
- "loc": {
632
- "start": {
633
- "line": 21,
634
- "column": 5
635
- },
636
- "end": {
637
- "line": 24,
638
- "column": 6
639
- },
640
- "sourcefile": "enum-trait-adapt.php"
641
- }
642
- },
643
- "_meta": {
644
- "loc": {
645
- "start": {
646
- "line": 21,
647
- "column": 5
648
- },
649
- "end": {
650
- "line": 24,
651
- "column": 6
652
- },
653
- "sourcefile": "enum-trait-adapt.php"
654
- }
655
- },
656
- "loc": {
657
- "start": {
658
- "line": 21,
659
- "column": 5
660
- },
661
- "end": {
662
- "line": 24,
663
- "column": 6
664
- },
665
- "sourcefile": "enum-trait-adapt.php"
666
- }
667
- }
668
- ],
669
- "supers": [],
670
- "_meta": {
671
- "loc": {
672
- "start": {
673
- "line": 19,
674
- "column": 1
675
- },
676
- "end": {
677
- "line": 25,
678
- "column": 2
679
- },
680
- "sourcefile": "enum-trait-adapt.php"
681
- }
682
- },
683
- "loc": {
684
- "start": {
685
- "line": 19,
686
- "column": 1
687
- },
688
- "end": {
689
- "line": 25,
690
- "column": 2
691
- },
692
- "sourcefile": "enum-trait-adapt.php"
693
- }
694
- },
695
- {
696
- "type": "ClassDefinition",
697
- "id": {
698
- "type": "Identifier",
699
- "name": "Status",
700
- "_meta": {
701
- "loc": {
702
- "start": {
703
- "line": 27,
704
- "column": 6
705
- },
706
- "end": {
707
- "line": 27,
708
- "column": 12
709
- },
710
- "sourcefile": "enum-trait-adapt.php"
711
- }
712
- },
713
- "loc": {
714
- "start": {
715
- "line": 27,
716
- "column": 6
717
- },
718
- "end": {
719
- "line": 27,
720
- "column": 12
721
- },
722
- "sourcefile": "enum-trait-adapt.php"
723
- }
724
- },
725
- "body": [
726
- {
727
- "type": "VariableDeclaration",
728
- "id": {
729
- "type": "Identifier",
730
- "name": "Open",
731
- "_meta": {
732
- "loc": {
733
- "start": {
734
- "line": 29,
735
- "column": 10
736
- },
737
- "end": {
738
- "line": 29,
739
- "column": 14
740
- },
741
- "sourcefile": "enum-trait-adapt.php"
742
- }
743
- },
744
- "loc": {
745
- "start": {
746
- "line": 29,
747
- "column": 10
748
- },
749
- "end": {
750
- "line": 29,
751
- "column": 14
752
- },
753
- "sourcefile": "enum-trait-adapt.php"
754
- }
755
- },
756
- "init": {
757
- "type": "Literal",
758
- "value": "open",
759
- "literalType": "string",
760
- "_meta": {
761
- "loc": {
762
- "start": {
763
- "line": 29,
764
- "column": 17
765
- },
766
- "end": {
767
- "line": 29,
768
- "column": 23
769
- },
770
- "sourcefile": "enum-trait-adapt.php"
771
- }
772
- },
773
- "loc": {
774
- "start": {
775
- "line": 29,
776
- "column": 17
777
- },
778
- "end": {
779
- "line": 29,
780
- "column": 23
781
- },
782
- "sourcefile": "enum-trait-adapt.php"
783
- }
784
- },
785
- "cloned": false,
786
- "varType": {
787
- "type": "DynamicType",
788
- "id": null,
789
- "_meta": {}
790
- },
791
- "_meta": {
792
- "enumCase": true,
793
- "loc": {
794
- "start": {
795
- "line": 29,
796
- "column": 5
797
- },
798
- "end": {
799
- "line": 29,
800
- "column": 24
801
- },
802
- "sourcefile": "enum-trait-adapt.php"
803
- }
804
- },
805
- "loc": {
806
- "start": {
807
- "line": 29,
808
- "column": 5
809
- },
810
- "end": {
811
- "line": 29,
812
- "column": 24
813
- },
814
- "sourcefile": "enum-trait-adapt.php"
815
- }
816
- },
817
- {
818
- "type": "VariableDeclaration",
819
- "id": {
820
- "type": "Identifier",
821
- "name": "Closed",
822
- "_meta": {
823
- "loc": {
824
- "start": {
825
- "line": 30,
826
- "column": 10
827
- },
828
- "end": {
829
- "line": 30,
830
- "column": 16
831
- },
832
- "sourcefile": "enum-trait-adapt.php"
833
- }
834
- },
835
- "loc": {
836
- "start": {
837
- "line": 30,
838
- "column": 10
839
- },
840
- "end": {
841
- "line": 30,
842
- "column": 16
843
- },
844
- "sourcefile": "enum-trait-adapt.php"
845
- }
846
- },
847
- "init": {
848
- "type": "Literal",
849
- "value": "closed",
850
- "literalType": "string",
851
- "_meta": {
852
- "loc": {
853
- "start": {
854
- "line": 30,
855
- "column": 19
856
- },
857
- "end": {
858
- "line": 30,
859
- "column": 27
860
- },
861
- "sourcefile": "enum-trait-adapt.php"
862
- }
863
- },
864
- "loc": {
865
- "start": {
866
- "line": 30,
867
- "column": 19
868
- },
869
- "end": {
870
- "line": 30,
871
- "column": 27
872
- },
873
- "sourcefile": "enum-trait-adapt.php"
874
- }
875
- },
876
- "cloned": false,
877
- "varType": {
878
- "type": "DynamicType",
879
- "id": null,
880
- "_meta": {}
881
- },
882
- "_meta": {
883
- "enumCase": true,
884
- "loc": {
885
- "start": {
886
- "line": 30,
887
- "column": 5
888
- },
889
- "end": {
890
- "line": 30,
891
- "column": 28
892
- },
893
- "sourcefile": "enum-trait-adapt.php"
894
- }
895
- },
896
- "loc": {
897
- "start": {
898
- "line": 30,
899
- "column": 5
900
- },
901
- "end": {
902
- "line": 30,
903
- "column": 28
904
- },
905
- "sourcefile": "enum-trait-adapt.php"
906
- }
907
- }
908
- ],
909
- "supers": [],
910
- "_meta": {
911
- "kind": "enum",
912
- "loc": {
913
- "start": {
914
- "line": 27,
915
- "column": 1
916
- },
917
- "end": {
918
- "line": 31,
919
- "column": 2
920
- },
921
- "sourcefile": "enum-trait-adapt.php"
922
- }
923
- },
924
- "loc": {
925
- "start": {
926
- "line": 27,
927
- "column": 1
928
- },
929
- "end": {
930
- "line": 31,
931
- "column": 2
932
- },
933
- "sourcefile": "enum-trait-adapt.php"
934
- }
935
- }
936
- ],
937
- "language": "php",
938
- "languageVersion": null,
939
- "uri": "enum-trait-adapt.php",
940
- "version": "0.0.0",
941
- "_meta": {
942
- "loc": {
943
- "start": {
944
- "line": 1,
945
- "column": 1
946
- },
947
- "end": {
948
- "line": 32,
949
- "column": 1
950
- },
951
- "sourcefile": "enum-trait-adapt.php"
952
- }
953
- },
954
- "loc": {
955
- "start": {
956
- "line": 1,
957
- "column": 1
958
- },
959
- "end": {
960
- "line": 32,
961
- "column": 1
962
- },
963
- "sourcefile": "enum-trait-adapt.php"
964
- }
965
- }