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