@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,2010 +0,0 @@
1
- {
2
- "type": "CompileUnit",
3
- "body": [
4
- {
5
- "type": "ForStatement",
6
- "init": {
7
- "type": "AssignmentExpression",
8
- "left": {
9
- "type": "Identifier",
10
- "name": "i",
11
- "_meta": {
12
- "loc": {
13
- "start": {
14
- "line": 3,
15
- "column": 6
16
- },
17
- "end": {
18
- "line": 3,
19
- "column": 8
20
- },
21
- "sourcefile": "control-flow.php"
22
- }
23
- },
24
- "loc": {
25
- "start": {
26
- "line": 3,
27
- "column": 6
28
- },
29
- "end": {
30
- "line": 3,
31
- "column": 8
32
- },
33
- "sourcefile": "control-flow.php"
34
- }
35
- },
36
- "right": {
37
- "type": "Literal",
38
- "value": 0,
39
- "literalType": "number",
40
- "_meta": {
41
- "loc": {
42
- "start": {
43
- "line": 3,
44
- "column": 11
45
- },
46
- "end": {
47
- "line": 3,
48
- "column": 12
49
- },
50
- "sourcefile": "control-flow.php"
51
- }
52
- },
53
- "loc": {
54
- "start": {
55
- "line": 3,
56
- "column": 11
57
- },
58
- "end": {
59
- "line": 3,
60
- "column": 12
61
- },
62
- "sourcefile": "control-flow.php"
63
- }
64
- },
65
- "operator": "=",
66
- "cloned": false,
67
- "_meta": {
68
- "loc": {
69
- "start": {
70
- "line": 3,
71
- "column": 6
72
- },
73
- "end": {
74
- "line": 3,
75
- "column": 12
76
- },
77
- "sourcefile": "control-flow.php"
78
- }
79
- },
80
- "loc": {
81
- "start": {
82
- "line": 3,
83
- "column": 6
84
- },
85
- "end": {
86
- "line": 3,
87
- "column": 12
88
- },
89
- "sourcefile": "control-flow.php"
90
- }
91
- },
92
- "test": {
93
- "type": "BinaryExpression",
94
- "operator": "<",
95
- "left": {
96
- "type": "Identifier",
97
- "name": "i",
98
- "_meta": {
99
- "loc": {
100
- "start": {
101
- "line": 3,
102
- "column": 14
103
- },
104
- "end": {
105
- "line": 3,
106
- "column": 16
107
- },
108
- "sourcefile": "control-flow.php"
109
- }
110
- },
111
- "loc": {
112
- "start": {
113
- "line": 3,
114
- "column": 14
115
- },
116
- "end": {
117
- "line": 3,
118
- "column": 16
119
- },
120
- "sourcefile": "control-flow.php"
121
- }
122
- },
123
- "right": {
124
- "type": "Literal",
125
- "value": 3,
126
- "literalType": "number",
127
- "_meta": {
128
- "loc": {
129
- "start": {
130
- "line": 3,
131
- "column": 19
132
- },
133
- "end": {
134
- "line": 3,
135
- "column": 20
136
- },
137
- "sourcefile": "control-flow.php"
138
- }
139
- },
140
- "loc": {
141
- "start": {
142
- "line": 3,
143
- "column": 19
144
- },
145
- "end": {
146
- "line": 3,
147
- "column": 20
148
- },
149
- "sourcefile": "control-flow.php"
150
- }
151
- },
152
- "_meta": {
153
- "loc": {
154
- "start": {
155
- "line": 3,
156
- "column": 14
157
- },
158
- "end": {
159
- "line": 3,
160
- "column": 20
161
- },
162
- "sourcefile": "control-flow.php"
163
- }
164
- },
165
- "loc": {
166
- "start": {
167
- "line": 3,
168
- "column": 14
169
- },
170
- "end": {
171
- "line": 3,
172
- "column": 20
173
- },
174
- "sourcefile": "control-flow.php"
175
- }
176
- },
177
- "update": {
178
- "type": "UnaryExpression",
179
- "operator": "++",
180
- "argument": {
181
- "type": "Identifier",
182
- "name": "i",
183
- "_meta": {
184
- "loc": {
185
- "start": {
186
- "line": 3,
187
- "column": 22
188
- },
189
- "end": {
190
- "line": 3,
191
- "column": 24
192
- },
193
- "sourcefile": "control-flow.php"
194
- }
195
- },
196
- "loc": {
197
- "start": {
198
- "line": 3,
199
- "column": 22
200
- },
201
- "end": {
202
- "line": 3,
203
- "column": 24
204
- },
205
- "sourcefile": "control-flow.php"
206
- }
207
- },
208
- "isSuffix": true,
209
- "_meta": {
210
- "loc": {
211
- "start": {
212
- "line": 3,
213
- "column": 22
214
- },
215
- "end": {
216
- "line": 3,
217
- "column": 26
218
- },
219
- "sourcefile": "control-flow.php"
220
- }
221
- },
222
- "loc": {
223
- "start": {
224
- "line": 3,
225
- "column": 22
226
- },
227
- "end": {
228
- "line": 3,
229
- "column": 26
230
- },
231
- "sourcefile": "control-flow.php"
232
- }
233
- },
234
- "body": {
235
- "type": "ScopedStatement",
236
- "body": [
237
- {
238
- "type": "ExpressionStatement",
239
- "expression": {
240
- "type": "CallExpression",
241
- "callee": {
242
- "type": "Identifier",
243
- "name": "echo",
244
- "_meta": {}
245
- },
246
- "arguments": [
247
- {
248
- "type": "Identifier",
249
- "name": "i",
250
- "_meta": {
251
- "loc": {
252
- "start": {
253
- "line": 4,
254
- "column": 10
255
- },
256
- "end": {
257
- "line": 4,
258
- "column": 12
259
- },
260
- "sourcefile": "control-flow.php"
261
- }
262
- },
263
- "loc": {
264
- "start": {
265
- "line": 4,
266
- "column": 10
267
- },
268
- "end": {
269
- "line": 4,
270
- "column": 12
271
- },
272
- "sourcefile": "control-flow.php"
273
- }
274
- }
275
- ],
276
- "_meta": {
277
- "loc": {
278
- "start": {
279
- "line": 4,
280
- "column": 5
281
- },
282
- "end": {
283
- "line": 4,
284
- "column": 13
285
- },
286
- "sourcefile": "control-flow.php"
287
- }
288
- },
289
- "loc": {
290
- "start": {
291
- "line": 4,
292
- "column": 5
293
- },
294
- "end": {
295
- "line": 4,
296
- "column": 13
297
- },
298
- "sourcefile": "control-flow.php"
299
- }
300
- },
301
- "_meta": {
302
- "loc": {
303
- "start": {
304
- "line": 4,
305
- "column": 5
306
- },
307
- "end": {
308
- "line": 4,
309
- "column": 13
310
- },
311
- "sourcefile": "control-flow.php"
312
- }
313
- },
314
- "loc": {
315
- "start": {
316
- "line": 4,
317
- "column": 5
318
- },
319
- "end": {
320
- "line": 4,
321
- "column": 13
322
- },
323
- "sourcefile": "control-flow.php"
324
- }
325
- }
326
- ],
327
- "id": null,
328
- "_meta": {
329
- "loc": {
330
- "start": {
331
- "line": 3,
332
- "column": 28
333
- },
334
- "end": {
335
- "line": 5,
336
- "column": 2
337
- },
338
- "sourcefile": "control-flow.php"
339
- }
340
- },
341
- "loc": {
342
- "start": {
343
- "line": 3,
344
- "column": 28
345
- },
346
- "end": {
347
- "line": 5,
348
- "column": 2
349
- },
350
- "sourcefile": "control-flow.php"
351
- }
352
- },
353
- "_meta": {
354
- "loc": {
355
- "start": {
356
- "line": 3,
357
- "column": 1
358
- },
359
- "end": {
360
- "line": 5,
361
- "column": 2
362
- },
363
- "sourcefile": "control-flow.php"
364
- }
365
- },
366
- "loc": {
367
- "start": {
368
- "line": 3,
369
- "column": 1
370
- },
371
- "end": {
372
- "line": 5,
373
- "column": 2
374
- },
375
- "sourcefile": "control-flow.php"
376
- }
377
- },
378
- {
379
- "type": "RangeStatement",
380
- "key": {
381
- "type": "VariableDeclaration",
382
- "id": {
383
- "type": "Identifier",
384
- "name": "k",
385
- "_meta": {
386
- "loc": {
387
- "start": {
388
- "line": 7,
389
- "column": 20
390
- },
391
- "end": {
392
- "line": 7,
393
- "column": 22
394
- },
395
- "sourcefile": "control-flow.php"
396
- }
397
- },
398
- "loc": {
399
- "start": {
400
- "line": 7,
401
- "column": 20
402
- },
403
- "end": {
404
- "line": 7,
405
- "column": 22
406
- },
407
- "sourcefile": "control-flow.php"
408
- }
409
- },
410
- "init": null,
411
- "cloned": false,
412
- "varType": {
413
- "type": "DynamicType",
414
- "id": null,
415
- "_meta": {}
416
- },
417
- "_meta": {
418
- "loc": {
419
- "start": {
420
- "line": 7,
421
- "column": 20
422
- },
423
- "end": {
424
- "line": 7,
425
- "column": 22
426
- },
427
- "sourcefile": "control-flow.php"
428
- }
429
- },
430
- "loc": {
431
- "start": {
432
- "line": 7,
433
- "column": 20
434
- },
435
- "end": {
436
- "line": 7,
437
- "column": 22
438
- },
439
- "sourcefile": "control-flow.php"
440
- }
441
- },
442
- "value": {
443
- "type": "VariableDeclaration",
444
- "id": {
445
- "type": "Identifier",
446
- "name": "v",
447
- "_meta": {
448
- "loc": {
449
- "start": {
450
- "line": 7,
451
- "column": 26
452
- },
453
- "end": {
454
- "line": 7,
455
- "column": 28
456
- },
457
- "sourcefile": "control-flow.php"
458
- }
459
- },
460
- "loc": {
461
- "start": {
462
- "line": 7,
463
- "column": 26
464
- },
465
- "end": {
466
- "line": 7,
467
- "column": 28
468
- },
469
- "sourcefile": "control-flow.php"
470
- }
471
- },
472
- "init": null,
473
- "cloned": false,
474
- "varType": {
475
- "type": "DynamicType",
476
- "id": null,
477
- "_meta": {}
478
- },
479
- "_meta": {
480
- "loc": {
481
- "start": {
482
- "line": 7,
483
- "column": 26
484
- },
485
- "end": {
486
- "line": 7,
487
- "column": 28
488
- },
489
- "sourcefile": "control-flow.php"
490
- }
491
- },
492
- "loc": {
493
- "start": {
494
- "line": 7,
495
- "column": 26
496
- },
497
- "end": {
498
- "line": 7,
499
- "column": 28
500
- },
501
- "sourcefile": "control-flow.php"
502
- }
503
- },
504
- "right": {
505
- "type": "Identifier",
506
- "name": "items",
507
- "_meta": {
508
- "loc": {
509
- "start": {
510
- "line": 7,
511
- "column": 10
512
- },
513
- "end": {
514
- "line": 7,
515
- "column": 16
516
- },
517
- "sourcefile": "control-flow.php"
518
- }
519
- },
520
- "loc": {
521
- "start": {
522
- "line": 7,
523
- "column": 10
524
- },
525
- "end": {
526
- "line": 7,
527
- "column": 16
528
- },
529
- "sourcefile": "control-flow.php"
530
- }
531
- },
532
- "body": {
533
- "type": "ScopedStatement",
534
- "body": [
535
- {
536
- "type": "IfStatement",
537
- "test": {
538
- "type": "Identifier",
539
- "name": "v",
540
- "_meta": {
541
- "loc": {
542
- "start": {
543
- "line": 8,
544
- "column": 9
545
- },
546
- "end": {
547
- "line": 8,
548
- "column": 11
549
- },
550
- "sourcefile": "control-flow.php"
551
- }
552
- },
553
- "loc": {
554
- "start": {
555
- "line": 8,
556
- "column": 9
557
- },
558
- "end": {
559
- "line": 8,
560
- "column": 11
561
- },
562
- "sourcefile": "control-flow.php"
563
- }
564
- },
565
- "consequent": {
566
- "type": "ScopedStatement",
567
- "body": [
568
- {
569
- "type": "ContinueStatement",
570
- "label": null,
571
- "_meta": {
572
- "loc": {
573
- "start": {
574
- "line": 9,
575
- "column": 9
576
- },
577
- "end": {
578
- "line": 9,
579
- "column": 18
580
- },
581
- "sourcefile": "control-flow.php"
582
- }
583
- },
584
- "loc": {
585
- "start": {
586
- "line": 9,
587
- "column": 9
588
- },
589
- "end": {
590
- "line": 9,
591
- "column": 18
592
- },
593
- "sourcefile": "control-flow.php"
594
- }
595
- }
596
- ],
597
- "id": null,
598
- "_meta": {
599
- "loc": {
600
- "start": {
601
- "line": 8,
602
- "column": 13
603
- },
604
- "end": {
605
- "line": 10,
606
- "column": 6
607
- },
608
- "sourcefile": "control-flow.php"
609
- }
610
- },
611
- "loc": {
612
- "start": {
613
- "line": 8,
614
- "column": 13
615
- },
616
- "end": {
617
- "line": 10,
618
- "column": 6
619
- },
620
- "sourcefile": "control-flow.php"
621
- }
622
- },
623
- "alternative": null,
624
- "_meta": {
625
- "loc": {
626
- "start": {
627
- "line": 8,
628
- "column": 5
629
- },
630
- "end": {
631
- "line": 10,
632
- "column": 6
633
- },
634
- "sourcefile": "control-flow.php"
635
- }
636
- },
637
- "loc": {
638
- "start": {
639
- "line": 8,
640
- "column": 5
641
- },
642
- "end": {
643
- "line": 10,
644
- "column": 6
645
- },
646
- "sourcefile": "control-flow.php"
647
- }
648
- },
649
- {
650
- "type": "BreakStatement",
651
- "label": null,
652
- "_meta": {
653
- "loc": {
654
- "start": {
655
- "line": 11,
656
- "column": 5
657
- },
658
- "end": {
659
- "line": 11,
660
- "column": 11
661
- },
662
- "sourcefile": "control-flow.php"
663
- }
664
- },
665
- "loc": {
666
- "start": {
667
- "line": 11,
668
- "column": 5
669
- },
670
- "end": {
671
- "line": 11,
672
- "column": 11
673
- },
674
- "sourcefile": "control-flow.php"
675
- }
676
- }
677
- ],
678
- "id": null,
679
- "_meta": {
680
- "loc": {
681
- "start": {
682
- "line": 7,
683
- "column": 30
684
- },
685
- "end": {
686
- "line": 12,
687
- "column": 2
688
- },
689
- "sourcefile": "control-flow.php"
690
- }
691
- },
692
- "loc": {
693
- "start": {
694
- "line": 7,
695
- "column": 30
696
- },
697
- "end": {
698
- "line": 12,
699
- "column": 2
700
- },
701
- "sourcefile": "control-flow.php"
702
- }
703
- },
704
- "_meta": {
705
- "loc": {
706
- "start": {
707
- "line": 7,
708
- "column": 1
709
- },
710
- "end": {
711
- "line": 12,
712
- "column": 2
713
- },
714
- "sourcefile": "control-flow.php"
715
- }
716
- },
717
- "loc": {
718
- "start": {
719
- "line": 7,
720
- "column": 1
721
- },
722
- "end": {
723
- "line": 12,
724
- "column": 2
725
- },
726
- "sourcefile": "control-flow.php"
727
- }
728
- },
729
- {
730
- "type": "WhileStatement",
731
- "test": {
732
- "type": "Identifier",
733
- "name": "ok",
734
- "_meta": {
735
- "loc": {
736
- "start": {
737
- "line": 14,
738
- "column": 8
739
- },
740
- "end": {
741
- "line": 14,
742
- "column": 11
743
- },
744
- "sourcefile": "control-flow.php"
745
- }
746
- },
747
- "loc": {
748
- "start": {
749
- "line": 14,
750
- "column": 8
751
- },
752
- "end": {
753
- "line": 14,
754
- "column": 11
755
- },
756
- "sourcefile": "control-flow.php"
757
- }
758
- },
759
- "body": {
760
- "type": "ScopedStatement",
761
- "body": [
762
- {
763
- "type": "ExpressionStatement",
764
- "expression": {
765
- "type": "CallExpression",
766
- "callee": {
767
- "type": "Identifier",
768
- "name": "risky",
769
- "_meta": {
770
- "loc": {
771
- "start": {
772
- "line": 15,
773
- "column": 5
774
- },
775
- "end": {
776
- "line": 15,
777
- "column": 10
778
- },
779
- "sourcefile": "control-flow.php"
780
- }
781
- },
782
- "loc": {
783
- "start": {
784
- "line": 15,
785
- "column": 5
786
- },
787
- "end": {
788
- "line": 15,
789
- "column": 10
790
- },
791
- "sourcefile": "control-flow.php"
792
- }
793
- },
794
- "arguments": [],
795
- "_meta": {
796
- "loc": {
797
- "start": {
798
- "line": 15,
799
- "column": 5
800
- },
801
- "end": {
802
- "line": 15,
803
- "column": 12
804
- },
805
- "sourcefile": "control-flow.php"
806
- }
807
- },
808
- "loc": {
809
- "start": {
810
- "line": 15,
811
- "column": 5
812
- },
813
- "end": {
814
- "line": 15,
815
- "column": 12
816
- },
817
- "sourcefile": "control-flow.php"
818
- }
819
- },
820
- "_meta": {
821
- "loc": {
822
- "start": {
823
- "line": 15,
824
- "column": 5
825
- },
826
- "end": {
827
- "line": 15,
828
- "column": 13
829
- },
830
- "sourcefile": "control-flow.php"
831
- }
832
- },
833
- "loc": {
834
- "start": {
835
- "line": 15,
836
- "column": 5
837
- },
838
- "end": {
839
- "line": 15,
840
- "column": 13
841
- },
842
- "sourcefile": "control-flow.php"
843
- }
844
- },
845
- {
846
- "type": "BreakStatement",
847
- "label": null,
848
- "_meta": {
849
- "loc": {
850
- "start": {
851
- "line": 16,
852
- "column": 5
853
- },
854
- "end": {
855
- "line": 16,
856
- "column": 11
857
- },
858
- "sourcefile": "control-flow.php"
859
- }
860
- },
861
- "loc": {
862
- "start": {
863
- "line": 16,
864
- "column": 5
865
- },
866
- "end": {
867
- "line": 16,
868
- "column": 11
869
- },
870
- "sourcefile": "control-flow.php"
871
- }
872
- }
873
- ],
874
- "id": null,
875
- "_meta": {
876
- "loc": {
877
- "start": {
878
- "line": 14,
879
- "column": 13
880
- },
881
- "end": {
882
- "line": 17,
883
- "column": 2
884
- },
885
- "sourcefile": "control-flow.php"
886
- }
887
- },
888
- "loc": {
889
- "start": {
890
- "line": 14,
891
- "column": 13
892
- },
893
- "end": {
894
- "line": 17,
895
- "column": 2
896
- },
897
- "sourcefile": "control-flow.php"
898
- }
899
- },
900
- "isPostTest": false,
901
- "_meta": {
902
- "loc": {
903
- "start": {
904
- "line": 14,
905
- "column": 1
906
- },
907
- "end": {
908
- "line": 17,
909
- "column": 2
910
- },
911
- "sourcefile": "control-flow.php"
912
- }
913
- },
914
- "loc": {
915
- "start": {
916
- "line": 14,
917
- "column": 1
918
- },
919
- "end": {
920
- "line": 17,
921
- "column": 2
922
- },
923
- "sourcefile": "control-flow.php"
924
- }
925
- },
926
- {
927
- "type": "WhileStatement",
928
- "test": {
929
- "type": "Identifier",
930
- "name": "flag",
931
- "_meta": {
932
- "loc": {
933
- "start": {
934
- "line": 21,
935
- "column": 10
936
- },
937
- "end": {
938
- "line": 21,
939
- "column": 15
940
- },
941
- "sourcefile": "control-flow.php"
942
- }
943
- },
944
- "loc": {
945
- "start": {
946
- "line": 21,
947
- "column": 10
948
- },
949
- "end": {
950
- "line": 21,
951
- "column": 15
952
- },
953
- "sourcefile": "control-flow.php"
954
- }
955
- },
956
- "body": {
957
- "type": "ScopedStatement",
958
- "body": [
959
- {
960
- "type": "ExpressionStatement",
961
- "expression": {
962
- "type": "AssignmentExpression",
963
- "left": {
964
- "type": "Identifier",
965
- "name": "x",
966
- "_meta": {
967
- "loc": {
968
- "start": {
969
- "line": 20,
970
- "column": 5
971
- },
972
- "end": {
973
- "line": 20,
974
- "column": 7
975
- },
976
- "sourcefile": "control-flow.php"
977
- }
978
- },
979
- "loc": {
980
- "start": {
981
- "line": 20,
982
- "column": 5
983
- },
984
- "end": {
985
- "line": 20,
986
- "column": 7
987
- },
988
- "sourcefile": "control-flow.php"
989
- }
990
- },
991
- "right": {
992
- "type": "Literal",
993
- "value": 1,
994
- "literalType": "number",
995
- "_meta": {
996
- "loc": {
997
- "start": {
998
- "line": 20,
999
- "column": 10
1000
- },
1001
- "end": {
1002
- "line": 20,
1003
- "column": 11
1004
- },
1005
- "sourcefile": "control-flow.php"
1006
- }
1007
- },
1008
- "loc": {
1009
- "start": {
1010
- "line": 20,
1011
- "column": 10
1012
- },
1013
- "end": {
1014
- "line": 20,
1015
- "column": 11
1016
- },
1017
- "sourcefile": "control-flow.php"
1018
- }
1019
- },
1020
- "operator": "=",
1021
- "cloned": false,
1022
- "_meta": {
1023
- "loc": {
1024
- "start": {
1025
- "line": 20,
1026
- "column": 5
1027
- },
1028
- "end": {
1029
- "line": 20,
1030
- "column": 11
1031
- },
1032
- "sourcefile": "control-flow.php"
1033
- }
1034
- },
1035
- "loc": {
1036
- "start": {
1037
- "line": 20,
1038
- "column": 5
1039
- },
1040
- "end": {
1041
- "line": 20,
1042
- "column": 11
1043
- },
1044
- "sourcefile": "control-flow.php"
1045
- }
1046
- },
1047
- "_meta": {
1048
- "loc": {
1049
- "start": {
1050
- "line": 20,
1051
- "column": 5
1052
- },
1053
- "end": {
1054
- "line": 20,
1055
- "column": 12
1056
- },
1057
- "sourcefile": "control-flow.php"
1058
- }
1059
- },
1060
- "loc": {
1061
- "start": {
1062
- "line": 20,
1063
- "column": 5
1064
- },
1065
- "end": {
1066
- "line": 20,
1067
- "column": 12
1068
- },
1069
- "sourcefile": "control-flow.php"
1070
- }
1071
- }
1072
- ],
1073
- "id": null,
1074
- "_meta": {
1075
- "loc": {
1076
- "start": {
1077
- "line": 19,
1078
- "column": 4
1079
- },
1080
- "end": {
1081
- "line": 21,
1082
- "column": 2
1083
- },
1084
- "sourcefile": "control-flow.php"
1085
- }
1086
- },
1087
- "loc": {
1088
- "start": {
1089
- "line": 19,
1090
- "column": 4
1091
- },
1092
- "end": {
1093
- "line": 21,
1094
- "column": 2
1095
- },
1096
- "sourcefile": "control-flow.php"
1097
- }
1098
- },
1099
- "isPostTest": true,
1100
- "_meta": {
1101
- "loc": {
1102
- "start": {
1103
- "line": 19,
1104
- "column": 1
1105
- },
1106
- "end": {
1107
- "line": 21,
1108
- "column": 17
1109
- },
1110
- "sourcefile": "control-flow.php"
1111
- }
1112
- },
1113
- "loc": {
1114
- "start": {
1115
- "line": 19,
1116
- "column": 1
1117
- },
1118
- "end": {
1119
- "line": 21,
1120
- "column": 17
1121
- },
1122
- "sourcefile": "control-flow.php"
1123
- }
1124
- },
1125
- {
1126
- "type": "SwitchStatement",
1127
- "discriminant": {
1128
- "type": "Identifier",
1129
- "name": "x",
1130
- "_meta": {
1131
- "loc": {
1132
- "start": {
1133
- "line": 23,
1134
- "column": 9
1135
- },
1136
- "end": {
1137
- "line": 23,
1138
- "column": 11
1139
- },
1140
- "sourcefile": "control-flow.php"
1141
- }
1142
- },
1143
- "loc": {
1144
- "start": {
1145
- "line": 23,
1146
- "column": 9
1147
- },
1148
- "end": {
1149
- "line": 23,
1150
- "column": 11
1151
- },
1152
- "sourcefile": "control-flow.php"
1153
- }
1154
- },
1155
- "cases": [
1156
- {
1157
- "type": "CaseClause",
1158
- "test": {
1159
- "type": "Literal",
1160
- "value": 1,
1161
- "literalType": "number",
1162
- "_meta": {
1163
- "loc": {
1164
- "start": {
1165
- "line": 24,
1166
- "column": 10
1167
- },
1168
- "end": {
1169
- "line": 24,
1170
- "column": 11
1171
- },
1172
- "sourcefile": "control-flow.php"
1173
- }
1174
- },
1175
- "loc": {
1176
- "start": {
1177
- "line": 24,
1178
- "column": 10
1179
- },
1180
- "end": {
1181
- "line": 24,
1182
- "column": 11
1183
- },
1184
- "sourcefile": "control-flow.php"
1185
- }
1186
- },
1187
- "body": {
1188
- "type": "ScopedStatement",
1189
- "body": [
1190
- {
1191
- "type": "ExpressionStatement",
1192
- "expression": {
1193
- "type": "CallExpression",
1194
- "callee": {
1195
- "type": "Identifier",
1196
- "name": "foo",
1197
- "_meta": {
1198
- "loc": {
1199
- "start": {
1200
- "line": 25,
1201
- "column": 9
1202
- },
1203
- "end": {
1204
- "line": 25,
1205
- "column": 12
1206
- },
1207
- "sourcefile": "control-flow.php"
1208
- }
1209
- },
1210
- "loc": {
1211
- "start": {
1212
- "line": 25,
1213
- "column": 9
1214
- },
1215
- "end": {
1216
- "line": 25,
1217
- "column": 12
1218
- },
1219
- "sourcefile": "control-flow.php"
1220
- }
1221
- },
1222
- "arguments": [],
1223
- "_meta": {
1224
- "loc": {
1225
- "start": {
1226
- "line": 25,
1227
- "column": 9
1228
- },
1229
- "end": {
1230
- "line": 25,
1231
- "column": 14
1232
- },
1233
- "sourcefile": "control-flow.php"
1234
- }
1235
- },
1236
- "loc": {
1237
- "start": {
1238
- "line": 25,
1239
- "column": 9
1240
- },
1241
- "end": {
1242
- "line": 25,
1243
- "column": 14
1244
- },
1245
- "sourcefile": "control-flow.php"
1246
- }
1247
- },
1248
- "_meta": {
1249
- "loc": {
1250
- "start": {
1251
- "line": 25,
1252
- "column": 9
1253
- },
1254
- "end": {
1255
- "line": 25,
1256
- "column": 15
1257
- },
1258
- "sourcefile": "control-flow.php"
1259
- }
1260
- },
1261
- "loc": {
1262
- "start": {
1263
- "line": 25,
1264
- "column": 9
1265
- },
1266
- "end": {
1267
- "line": 25,
1268
- "column": 15
1269
- },
1270
- "sourcefile": "control-flow.php"
1271
- }
1272
- },
1273
- {
1274
- "type": "BreakStatement",
1275
- "label": null,
1276
- "_meta": {
1277
- "loc": {
1278
- "start": {
1279
- "line": 26,
1280
- "column": 9
1281
- },
1282
- "end": {
1283
- "line": 26,
1284
- "column": 15
1285
- },
1286
- "sourcefile": "control-flow.php"
1287
- }
1288
- },
1289
- "loc": {
1290
- "start": {
1291
- "line": 26,
1292
- "column": 9
1293
- },
1294
- "end": {
1295
- "line": 26,
1296
- "column": 15
1297
- },
1298
- "sourcefile": "control-flow.php"
1299
- }
1300
- }
1301
- ],
1302
- "id": null,
1303
- "_meta": {
1304
- "loc": {
1305
- "start": {
1306
- "line": 24,
1307
- "column": 5
1308
- },
1309
- "end": {
1310
- "line": 26,
1311
- "column": 15
1312
- },
1313
- "sourcefile": "control-flow.php"
1314
- }
1315
- },
1316
- "loc": {
1317
- "start": {
1318
- "line": 24,
1319
- "column": 5
1320
- },
1321
- "end": {
1322
- "line": 26,
1323
- "column": 15
1324
- },
1325
- "sourcefile": "control-flow.php"
1326
- }
1327
- },
1328
- "_meta": {
1329
- "loc": {
1330
- "start": {
1331
- "line": 24,
1332
- "column": 5
1333
- },
1334
- "end": {
1335
- "line": 26,
1336
- "column": 15
1337
- },
1338
- "sourcefile": "control-flow.php"
1339
- }
1340
- },
1341
- "loc": {
1342
- "start": {
1343
- "line": 24,
1344
- "column": 5
1345
- },
1346
- "end": {
1347
- "line": 26,
1348
- "column": 15
1349
- },
1350
- "sourcefile": "control-flow.php"
1351
- }
1352
- },
1353
- {
1354
- "type": "CaseClause",
1355
- "test": null,
1356
- "body": {
1357
- "type": "ScopedStatement",
1358
- "body": [
1359
- {
1360
- "type": "ExpressionStatement",
1361
- "expression": {
1362
- "type": "CallExpression",
1363
- "callee": {
1364
- "type": "Identifier",
1365
- "name": "bar",
1366
- "_meta": {
1367
- "loc": {
1368
- "start": {
1369
- "line": 28,
1370
- "column": 9
1371
- },
1372
- "end": {
1373
- "line": 28,
1374
- "column": 12
1375
- },
1376
- "sourcefile": "control-flow.php"
1377
- }
1378
- },
1379
- "loc": {
1380
- "start": {
1381
- "line": 28,
1382
- "column": 9
1383
- },
1384
- "end": {
1385
- "line": 28,
1386
- "column": 12
1387
- },
1388
- "sourcefile": "control-flow.php"
1389
- }
1390
- },
1391
- "arguments": [],
1392
- "_meta": {
1393
- "loc": {
1394
- "start": {
1395
- "line": 28,
1396
- "column": 9
1397
- },
1398
- "end": {
1399
- "line": 28,
1400
- "column": 14
1401
- },
1402
- "sourcefile": "control-flow.php"
1403
- }
1404
- },
1405
- "loc": {
1406
- "start": {
1407
- "line": 28,
1408
- "column": 9
1409
- },
1410
- "end": {
1411
- "line": 28,
1412
- "column": 14
1413
- },
1414
- "sourcefile": "control-flow.php"
1415
- }
1416
- },
1417
- "_meta": {
1418
- "loc": {
1419
- "start": {
1420
- "line": 28,
1421
- "column": 9
1422
- },
1423
- "end": {
1424
- "line": 28,
1425
- "column": 15
1426
- },
1427
- "sourcefile": "control-flow.php"
1428
- }
1429
- },
1430
- "loc": {
1431
- "start": {
1432
- "line": 28,
1433
- "column": 9
1434
- },
1435
- "end": {
1436
- "line": 28,
1437
- "column": 15
1438
- },
1439
- "sourcefile": "control-flow.php"
1440
- }
1441
- }
1442
- ],
1443
- "id": null,
1444
- "_meta": {
1445
- "loc": {
1446
- "start": {
1447
- "line": 27,
1448
- "column": 5
1449
- },
1450
- "end": {
1451
- "line": 28,
1452
- "column": 15
1453
- },
1454
- "sourcefile": "control-flow.php"
1455
- }
1456
- },
1457
- "loc": {
1458
- "start": {
1459
- "line": 27,
1460
- "column": 5
1461
- },
1462
- "end": {
1463
- "line": 28,
1464
- "column": 15
1465
- },
1466
- "sourcefile": "control-flow.php"
1467
- }
1468
- },
1469
- "_meta": {
1470
- "loc": {
1471
- "start": {
1472
- "line": 27,
1473
- "column": 5
1474
- },
1475
- "end": {
1476
- "line": 28,
1477
- "column": 15
1478
- },
1479
- "sourcefile": "control-flow.php"
1480
- }
1481
- },
1482
- "loc": {
1483
- "start": {
1484
- "line": 27,
1485
- "column": 5
1486
- },
1487
- "end": {
1488
- "line": 28,
1489
- "column": 15
1490
- },
1491
- "sourcefile": "control-flow.php"
1492
- }
1493
- }
1494
- ],
1495
- "_meta": {
1496
- "loc": {
1497
- "start": {
1498
- "line": 23,
1499
- "column": 1
1500
- },
1501
- "end": {
1502
- "line": 29,
1503
- "column": 2
1504
- },
1505
- "sourcefile": "control-flow.php"
1506
- }
1507
- },
1508
- "loc": {
1509
- "start": {
1510
- "line": 23,
1511
- "column": 1
1512
- },
1513
- "end": {
1514
- "line": 29,
1515
- "column": 2
1516
- },
1517
- "sourcefile": "control-flow.php"
1518
- }
1519
- },
1520
- {
1521
- "type": "TryStatement",
1522
- "body": {
1523
- "type": "ScopedStatement",
1524
- "body": [
1525
- {
1526
- "type": "ExpressionStatement",
1527
- "expression": {
1528
- "type": "CallExpression",
1529
- "callee": {
1530
- "type": "Identifier",
1531
- "name": "risky",
1532
- "_meta": {
1533
- "loc": {
1534
- "start": {
1535
- "line": 32,
1536
- "column": 5
1537
- },
1538
- "end": {
1539
- "line": 32,
1540
- "column": 10
1541
- },
1542
- "sourcefile": "control-flow.php"
1543
- }
1544
- },
1545
- "loc": {
1546
- "start": {
1547
- "line": 32,
1548
- "column": 5
1549
- },
1550
- "end": {
1551
- "line": 32,
1552
- "column": 10
1553
- },
1554
- "sourcefile": "control-flow.php"
1555
- }
1556
- },
1557
- "arguments": [],
1558
- "_meta": {
1559
- "loc": {
1560
- "start": {
1561
- "line": 32,
1562
- "column": 5
1563
- },
1564
- "end": {
1565
- "line": 32,
1566
- "column": 12
1567
- },
1568
- "sourcefile": "control-flow.php"
1569
- }
1570
- },
1571
- "loc": {
1572
- "start": {
1573
- "line": 32,
1574
- "column": 5
1575
- },
1576
- "end": {
1577
- "line": 32,
1578
- "column": 12
1579
- },
1580
- "sourcefile": "control-flow.php"
1581
- }
1582
- },
1583
- "_meta": {
1584
- "loc": {
1585
- "start": {
1586
- "line": 32,
1587
- "column": 5
1588
- },
1589
- "end": {
1590
- "line": 32,
1591
- "column": 13
1592
- },
1593
- "sourcefile": "control-flow.php"
1594
- }
1595
- },
1596
- "loc": {
1597
- "start": {
1598
- "line": 32,
1599
- "column": 5
1600
- },
1601
- "end": {
1602
- "line": 32,
1603
- "column": 13
1604
- },
1605
- "sourcefile": "control-flow.php"
1606
- }
1607
- }
1608
- ],
1609
- "id": null,
1610
- "_meta": {
1611
- "loc": {
1612
- "start": {
1613
- "line": 31,
1614
- "column": 5
1615
- },
1616
- "end": {
1617
- "line": 33,
1618
- "column": 2
1619
- },
1620
- "sourcefile": "control-flow.php"
1621
- }
1622
- },
1623
- "loc": {
1624
- "start": {
1625
- "line": 31,
1626
- "column": 5
1627
- },
1628
- "end": {
1629
- "line": 33,
1630
- "column": 2
1631
- },
1632
- "sourcefile": "control-flow.php"
1633
- }
1634
- },
1635
- "handlers": [
1636
- {
1637
- "type": "CatchClause",
1638
- "parameter": [
1639
- {
1640
- "type": "VariableDeclaration",
1641
- "id": {
1642
- "type": "Identifier",
1643
- "name": "e",
1644
- "_meta": {
1645
- "loc": {
1646
- "start": {
1647
- "line": 33,
1648
- "column": 21
1649
- },
1650
- "end": {
1651
- "line": 33,
1652
- "column": 23
1653
- },
1654
- "sourcefile": "control-flow.php"
1655
- }
1656
- },
1657
- "loc": {
1658
- "start": {
1659
- "line": 33,
1660
- "column": 21
1661
- },
1662
- "end": {
1663
- "line": 33,
1664
- "column": 23
1665
- },
1666
- "sourcefile": "control-flow.php"
1667
- }
1668
- },
1669
- "init": null,
1670
- "cloned": false,
1671
- "varType": {
1672
- "type": "DynamicType",
1673
- "id": null,
1674
- "_meta": {}
1675
- },
1676
- "_meta": {
1677
- "catchTypes": [
1678
- {
1679
- "type": "Identifier",
1680
- "name": "\\Exception",
1681
- "_meta": {
1682
- "loc": {
1683
- "start": {
1684
- "line": 33,
1685
- "column": 10
1686
- },
1687
- "end": {
1688
- "line": 33,
1689
- "column": 20
1690
- },
1691
- "sourcefile": "control-flow.php"
1692
- }
1693
- },
1694
- "loc": {
1695
- "start": {
1696
- "line": 33,
1697
- "column": 10
1698
- },
1699
- "end": {
1700
- "line": 33,
1701
- "column": 20
1702
- },
1703
- "sourcefile": "control-flow.php"
1704
- }
1705
- }
1706
- ],
1707
- "loc": {
1708
- "start": {
1709
- "line": 33,
1710
- "column": 3
1711
- },
1712
- "end": {
1713
- "line": 35,
1714
- "column": 2
1715
- },
1716
- "sourcefile": "control-flow.php"
1717
- }
1718
- },
1719
- "loc": {
1720
- "start": {
1721
- "line": 33,
1722
- "column": 3
1723
- },
1724
- "end": {
1725
- "line": 35,
1726
- "column": 2
1727
- },
1728
- "sourcefile": "control-flow.php"
1729
- }
1730
- }
1731
- ],
1732
- "body": {
1733
- "type": "ScopedStatement",
1734
- "body": [
1735
- {
1736
- "type": "ThrowStatement",
1737
- "argument": {
1738
- "type": "Identifier",
1739
- "name": "e",
1740
- "_meta": {
1741
- "loc": {
1742
- "start": {
1743
- "line": 34,
1744
- "column": 11
1745
- },
1746
- "end": {
1747
- "line": 34,
1748
- "column": 13
1749
- },
1750
- "sourcefile": "control-flow.php"
1751
- }
1752
- },
1753
- "loc": {
1754
- "start": {
1755
- "line": 34,
1756
- "column": 11
1757
- },
1758
- "end": {
1759
- "line": 34,
1760
- "column": 13
1761
- },
1762
- "sourcefile": "control-flow.php"
1763
- }
1764
- },
1765
- "_meta": {
1766
- "loc": {
1767
- "start": {
1768
- "line": 34,
1769
- "column": 5
1770
- },
1771
- "end": {
1772
- "line": 34,
1773
- "column": 14
1774
- },
1775
- "sourcefile": "control-flow.php"
1776
- }
1777
- },
1778
- "loc": {
1779
- "start": {
1780
- "line": 34,
1781
- "column": 5
1782
- },
1783
- "end": {
1784
- "line": 34,
1785
- "column": 14
1786
- },
1787
- "sourcefile": "control-flow.php"
1788
- }
1789
- }
1790
- ],
1791
- "id": null,
1792
- "_meta": {
1793
- "loc": {
1794
- "start": {
1795
- "line": 33,
1796
- "column": 25
1797
- },
1798
- "end": {
1799
- "line": 35,
1800
- "column": 2
1801
- },
1802
- "sourcefile": "control-flow.php"
1803
- }
1804
- },
1805
- "loc": {
1806
- "start": {
1807
- "line": 33,
1808
- "column": 25
1809
- },
1810
- "end": {
1811
- "line": 35,
1812
- "column": 2
1813
- },
1814
- "sourcefile": "control-flow.php"
1815
- }
1816
- },
1817
- "_meta": {
1818
- "loc": {
1819
- "start": {
1820
- "line": 33,
1821
- "column": 3
1822
- },
1823
- "end": {
1824
- "line": 35,
1825
- "column": 2
1826
- },
1827
- "sourcefile": "control-flow.php"
1828
- }
1829
- },
1830
- "loc": {
1831
- "start": {
1832
- "line": 33,
1833
- "column": 3
1834
- },
1835
- "end": {
1836
- "line": 35,
1837
- "column": 2
1838
- },
1839
- "sourcefile": "control-flow.php"
1840
- }
1841
- }
1842
- ],
1843
- "finalizer": {
1844
- "type": "ScopedStatement",
1845
- "body": [
1846
- {
1847
- "type": "ExpressionStatement",
1848
- "expression": {
1849
- "type": "CallExpression",
1850
- "callee": {
1851
- "type": "Identifier",
1852
- "name": "cleanup",
1853
- "_meta": {
1854
- "loc": {
1855
- "start": {
1856
- "line": 36,
1857
- "column": 5
1858
- },
1859
- "end": {
1860
- "line": 36,
1861
- "column": 12
1862
- },
1863
- "sourcefile": "control-flow.php"
1864
- }
1865
- },
1866
- "loc": {
1867
- "start": {
1868
- "line": 36,
1869
- "column": 5
1870
- },
1871
- "end": {
1872
- "line": 36,
1873
- "column": 12
1874
- },
1875
- "sourcefile": "control-flow.php"
1876
- }
1877
- },
1878
- "arguments": [],
1879
- "_meta": {
1880
- "loc": {
1881
- "start": {
1882
- "line": 36,
1883
- "column": 5
1884
- },
1885
- "end": {
1886
- "line": 36,
1887
- "column": 14
1888
- },
1889
- "sourcefile": "control-flow.php"
1890
- }
1891
- },
1892
- "loc": {
1893
- "start": {
1894
- "line": 36,
1895
- "column": 5
1896
- },
1897
- "end": {
1898
- "line": 36,
1899
- "column": 14
1900
- },
1901
- "sourcefile": "control-flow.php"
1902
- }
1903
- },
1904
- "_meta": {
1905
- "loc": {
1906
- "start": {
1907
- "line": 36,
1908
- "column": 5
1909
- },
1910
- "end": {
1911
- "line": 36,
1912
- "column": 15
1913
- },
1914
- "sourcefile": "control-flow.php"
1915
- }
1916
- },
1917
- "loc": {
1918
- "start": {
1919
- "line": 36,
1920
- "column": 5
1921
- },
1922
- "end": {
1923
- "line": 36,
1924
- "column": 15
1925
- },
1926
- "sourcefile": "control-flow.php"
1927
- }
1928
- }
1929
- ],
1930
- "id": null,
1931
- "_meta": {
1932
- "loc": {
1933
- "start": {
1934
- "line": 35,
1935
- "column": 11
1936
- },
1937
- "end": {
1938
- "line": 37,
1939
- "column": 2
1940
- },
1941
- "sourcefile": "control-flow.php"
1942
- }
1943
- },
1944
- "loc": {
1945
- "start": {
1946
- "line": 35,
1947
- "column": 11
1948
- },
1949
- "end": {
1950
- "line": 37,
1951
- "column": 2
1952
- },
1953
- "sourcefile": "control-flow.php"
1954
- }
1955
- },
1956
- "_meta": {
1957
- "loc": {
1958
- "start": {
1959
- "line": 31,
1960
- "column": 1
1961
- },
1962
- "end": {
1963
- "line": 37,
1964
- "column": 2
1965
- },
1966
- "sourcefile": "control-flow.php"
1967
- }
1968
- },
1969
- "loc": {
1970
- "start": {
1971
- "line": 31,
1972
- "column": 1
1973
- },
1974
- "end": {
1975
- "line": 37,
1976
- "column": 2
1977
- },
1978
- "sourcefile": "control-flow.php"
1979
- }
1980
- }
1981
- ],
1982
- "language": "php",
1983
- "languageVersion": null,
1984
- "uri": "control-flow.php",
1985
- "version": "0.0.0",
1986
- "_meta": {
1987
- "loc": {
1988
- "start": {
1989
- "line": 1,
1990
- "column": 1
1991
- },
1992
- "end": {
1993
- "line": 38,
1994
- "column": 1
1995
- },
1996
- "sourcefile": "control-flow.php"
1997
- }
1998
- },
1999
- "loc": {
2000
- "start": {
2001
- "line": 1,
2002
- "column": 1
2003
- },
2004
- "end": {
2005
- "line": 38,
2006
- "column": 1
2007
- },
2008
- "sourcefile": "control-flow.php"
2009
- }
2010
- }