Use JSON for FFP tests
[hiphop-php.git] / hphp / hack / test / full_fidelity / cases / context / test_extra_error_trivia.php.json.exp
blob046cd7ec52b57e3c82427ded812e19c9d0d73c8f
2 "parse_tree":{
3 "kind":"script",
4 "script_declarations":{
5 "kind":"list",
6 "elements":[
8 "kind":"markup_section",
9 "markup_text":{
10 "kind":"token",
11 "token":{
12 "kind":"markup",
13 "text":"",
14 "offset":0,
15 "leading_width":0,
16 "width":0,
17 "trailing_width":0,
18 "leading":[],
19 "trailing":[],
20 "line_number":1
23 "markup_suffix":{
24 "kind":"markup_suffix",
25 "markup_suffix_less_than_question":{
26 "kind":"token",
27 "token":{
28 "kind":"<?",
29 "text":"<?",
30 "offset":0,
31 "leading_width":0,
32 "width":2,
33 "trailing_width":0,
34 "leading":[],
35 "trailing":[],
36 "line_number":1
39 "markup_suffix_name":{
40 "kind":"token",
41 "token":{
42 "kind":"name",
43 "text":"hh",
44 "offset":2,
45 "leading_width":0,
46 "width":2,
47 "trailing_width":1,
48 "leading":[],
49 "trailing":[{"kind":"end_of_line","text":"\n","offset":4,"width":1}],
50 "line_number":1
56 "kind":"classish_declaration",
57 "classish_attribute":{"kind":"missing"},
58 "classish_modifiers":{"kind":"missing"},
59 "classish_xhp":{"kind":"missing"},
60 "classish_keyword":{
61 "kind":"token",
62 "token":{
63 "kind":"class",
64 "text":"class",
65 "offset":5,
66 "leading_width":1,
67 "width":5,
68 "trailing_width":1,
69 "leading":[{"kind":"end_of_line","text":"\n","offset":5,"width":1}],
70 "trailing":[{"kind":"whitespace","text":" ","offset":11,"width":1}],
71 "line_number":3
74 "classish_name":{
75 "kind":"token",
76 "token":{
77 "kind":"name",
78 "text":"C",
79 "offset":12,
80 "leading_width":0,
81 "width":1,
82 "trailing_width":1,
83 "leading":[],
84 "trailing":[{"kind":"whitespace","text":" ","offset":13,"width":1}],
85 "line_number":3
88 "classish_type_parameters":{"kind":"missing"},
89 "classish_extends_keyword":{"kind":"missing"},
90 "classish_extends_list":{"kind":"missing"},
91 "classish_implements_keyword":{"kind":"missing"},
92 "classish_implements_list":{"kind":"missing"},
93 "classish_where_clause":{"kind":"missing"},
94 "classish_body":{
95 "kind":"classish_body",
96 "classish_body_left_brace":{
97 "kind":"token",
98 "token":{
99 "kind":"{",
100 "text":"{",
101 "offset":14,
102 "leading_width":0,
103 "width":1,
104 "trailing_width":1,
105 "leading":[],
106 "trailing":[{"kind":"end_of_line","text":"\n","offset":15,"width":1}],
107 "line_number":3
110 "classish_body_elements":{
111 "kind":"list",
112 "elements":[
114 "kind":"methodish_declaration",
115 "methodish_attribute":{"kind":"missing"},
116 "methodish_function_decl_header":{
117 "kind":"function_declaration_header",
118 "function_modifiers":{
119 "kind":"list",
120 "elements":[
122 "kind":"token",
123 "token":{
124 "kind":"public",
125 "text":"public",
126 "offset":16,
127 "leading_width":35,
128 "width":6,
129 "trailing_width":1,
130 "leading":[
131 {"kind":"end_of_line","text":"\n","offset":16,"width":1},
132 {"kind":"whitespace","text":" ","offset":17,"width":2},
134 "kind":"single_line_comment",
135 "text":"// 'sta' becomes error trivia",
136 "offset":19,
137 "width":29
139 {"kind":"end_of_line","text":"\n","offset":48,"width":1},
140 {"kind":"whitespace","text":" ","offset":49,"width":2}
142 "trailing":[{"kind":"whitespace","text":" ","offset":57,"width":1}],
143 "line_number":6
148 "function_keyword":{
149 "kind":"token",
150 "token":{
151 "kind":"function",
152 "text":"function",
153 "offset":62,
154 "leading_width":0,
155 "width":8,
156 "trailing_width":1,
157 "leading":[
158 {"kind":"extra_token_error","text":"f()","offset":71,"width":3},
159 {"kind":"whitespace","text":" ","offset":61,"width":1}
161 "trailing":[{"kind":"whitespace","text":" ","offset":70,"width":1}],
162 "line_number":6
165 "function_name":{
166 "kind":"token",
167 "token":{
168 "kind":"name",
169 "text":"f",
170 "offset":71,
171 "leading_width":0,
172 "width":1,
173 "trailing_width":0,
174 "leading":[],
175 "trailing":[],
176 "line_number":6
179 "function_type_parameter_list":{"kind":"missing"},
180 "function_left_paren":{
181 "kind":"token",
182 "token":{
183 "kind":"(",
184 "text":"(",
185 "offset":72,
186 "leading_width":0,
187 "width":1,
188 "trailing_width":0,
189 "leading":[],
190 "trailing":[],
191 "line_number":6
194 "function_parameter_list":{"kind":"missing"},
195 "function_right_paren":{
196 "kind":"token",
197 "token":{
198 "kind":")",
199 "text":")",
200 "offset":73,
201 "leading_width":0,
202 "width":1,
203 "trailing_width":1,
204 "leading":[],
205 "trailing":[{"kind":"whitespace","text":" ","offset":74,"width":1}],
206 "line_number":6
209 "function_colon":{"kind":"missing"},
210 "function_type":{"kind":"missing"},
211 "function_where_clause":{"kind":"missing"}
213 "methodish_function_body":{
214 "kind":"compound_statement",
215 "compound_left_brace":{
216 "kind":"token",
217 "token":{
218 "kind":"{",
219 "text":"{",
220 "offset":75,
221 "leading_width":0,
222 "width":1,
223 "trailing_width":1,
224 "leading":[],
225 "trailing":[{"kind":"end_of_line","text":"\n","offset":76,"width":1}],
226 "line_number":6
229 "compound_statements":{"kind":"missing"},
230 "compound_right_brace":{
231 "kind":"token",
232 "token":{
233 "kind":"}",
234 "text":"}",
235 "offset":77,
236 "leading_width":2,
237 "width":1,
238 "trailing_width":1,
239 "leading":[{"kind":"whitespace","text":" ","offset":77,"width":2}],
240 "trailing":[{"kind":"end_of_line","text":"\n","offset":80,"width":1}],
241 "line_number":7
245 "methodish_semicolon":{"kind":"missing"}
248 "kind":"methodish_declaration",
249 "methodish_attribute":{"kind":"missing"},
250 "methodish_function_decl_header":{
251 "kind":"function_declaration_header",
252 "function_modifiers":{
253 "kind":"list",
254 "elements":[
256 "kind":"token",
257 "token":{
258 "kind":"public",
259 "text":"public",
260 "offset":81,
261 "leading_width":47,
262 "width":6,
263 "trailing_width":1,
264 "leading":[
265 {"kind":"end_of_line","text":"\n","offset":81,"width":1},
266 {"kind":"whitespace","text":" ","offset":82,"width":2},
268 "kind":"single_line_comment",
269 "text":"// 'meaninglessword' becomes error trivia",
270 "offset":84,
271 "width":41
273 {"kind":"end_of_line","text":"\n","offset":125,"width":1},
274 {"kind":"whitespace","text":" ","offset":126,"width":2}
276 "trailing":[{"kind":"whitespace","text":" ","offset":134,"width":1}],
277 "line_number":10
281 "kind":"token",
282 "token":{
283 "kind":"static",
284 "text":"static",
285 "offset":135,
286 "leading_width":0,
287 "width":6,
288 "trailing_width":1,
289 "leading":[],
290 "trailing":[{"kind":"whitespace","text":" ","offset":141,"width":1}],
291 "line_number":10
296 "function_keyword":{
297 "kind":"token",
298 "token":{
299 "kind":"function",
300 "text":"function",
301 "offset":158,
302 "leading_width":0,
303 "width":8,
304 "trailing_width":1,
305 "leading":[
307 "kind":"extra_token_error",
308 "text":"f() {\n }\n\n //",
309 "offset":167,
310 "width":15
312 {"kind":"whitespace","text":" ","offset":157,"width":1}
314 "trailing":[{"kind":"whitespace","text":" ","offset":166,"width":1}],
315 "line_number":10
318 "function_name":{
319 "kind":"token",
320 "token":{
321 "kind":"name",
322 "text":"f",
323 "offset":167,
324 "leading_width":0,
325 "width":1,
326 "trailing_width":0,
327 "leading":[],
328 "trailing":[],
329 "line_number":10
332 "function_type_parameter_list":{"kind":"missing"},
333 "function_left_paren":{
334 "kind":"token",
335 "token":{
336 "kind":"(",
337 "text":"(",
338 "offset":168,
339 "leading_width":0,
340 "width":1,
341 "trailing_width":0,
342 "leading":[],
343 "trailing":[],
344 "line_number":10
347 "function_parameter_list":{"kind":"missing"},
348 "function_right_paren":{
349 "kind":"token",
350 "token":{
351 "kind":")",
352 "text":")",
353 "offset":169,
354 "leading_width":0,
355 "width":1,
356 "trailing_width":1,
357 "leading":[],
358 "trailing":[{"kind":"whitespace","text":" ","offset":170,"width":1}],
359 "line_number":10
362 "function_colon":{"kind":"missing"},
363 "function_type":{"kind":"missing"},
364 "function_where_clause":{"kind":"missing"}
366 "methodish_function_body":{
367 "kind":"compound_statement",
368 "compound_left_brace":{
369 "kind":"token",
370 "token":{
371 "kind":"{",
372 "text":"{",
373 "offset":171,
374 "leading_width":0,
375 "width":1,
376 "trailing_width":1,
377 "leading":[],
378 "trailing":[{"kind":"end_of_line","text":"\n","offset":172,"width":1}],
379 "line_number":10
382 "compound_statements":{"kind":"missing"},
383 "compound_right_brace":{
384 "kind":"token",
385 "token":{
386 "kind":"}",
387 "text":"}",
388 "offset":173,
389 "leading_width":2,
390 "width":1,
391 "trailing_width":1,
392 "leading":[{"kind":"whitespace","text":" ","offset":173,"width":2}],
393 "trailing":[{"kind":"end_of_line","text":"\n","offset":176,"width":1}],
394 "line_number":11
398 "methodish_semicolon":{"kind":"missing"}
401 "kind":"property_declaration",
402 "property_attribute_spec":{"kind":"missing"},
403 "property_modifiers":{
404 "kind":"list",
405 "elements":[
407 "kind":"token",
408 "token":{
409 "kind":"public",
410 "text":"public",
411 "offset":177,
412 "leading_width":29,
413 "width":6,
414 "trailing_width":1,
415 "leading":[
416 {"kind":"end_of_line","text":"\n","offset":177,"width":1},
417 {"kind":"whitespace","text":" ","offset":178,"width":2},
419 "kind":"single_line_comment",
420 "text":"// no change in parsing",
421 "offset":180,
422 "width":23
424 {"kind":"end_of_line","text":"\n","offset":203,"width":1},
425 {"kind":"whitespace","text":" ","offset":204,"width":2}
427 "trailing":[{"kind":"whitespace","text":" ","offset":212,"width":1}],
428 "line_number":14
433 "property_type":{
434 "kind":"simple_type_specifier",
435 "simple_type_specifier":{
436 "kind":"token",
437 "token":{
438 "kind":"name",
439 "text":"meaninglessword",
440 "offset":213,
441 "leading_width":0,
442 "width":15,
443 "trailing_width":1,
444 "leading":[],
445 "trailing":[{"kind":"whitespace","text":" ","offset":228,"width":1}],
446 "line_number":14
450 "property_declarators":{
451 "kind":"list",
452 "elements":[
454 "kind":"list_item",
455 "list_item":{
456 "kind":"property_declarator",
457 "property_name":{"kind":"missing"},
458 "property_initializer":{"kind":"missing"}
460 "list_separator":{"kind":"missing"}
464 "property_semicolon":{"kind":"missing"}
467 "kind":"methodish_declaration",
468 "methodish_attribute":{"kind":"missing"},
469 "methodish_function_decl_header":{
470 "kind":"function_declaration_header",
471 "function_modifiers":{
472 "kind":"list",
473 "elements":[
475 "kind":"token",
476 "token":{
477 "kind":"static",
478 "text":"static",
479 "offset":229,
480 "leading_width":0,
481 "width":6,
482 "trailing_width":1,
483 "leading":[],
484 "trailing":[{"kind":"whitespace","text":" ","offset":235,"width":1}],
485 "line_number":14
490 "function_keyword":{
491 "kind":"token",
492 "token":{
493 "kind":"function",
494 "text":"function",
495 "offset":236,
496 "leading_width":0,
497 "width":8,
498 "trailing_width":1,
499 "leading":[],
500 "trailing":[{"kind":"whitespace","text":" ","offset":244,"width":1}],
501 "line_number":14
504 "function_name":{
505 "kind":"token",
506 "token":{
507 "kind":"name",
508 "text":"f",
509 "offset":245,
510 "leading_width":0,
511 "width":1,
512 "trailing_width":0,
513 "leading":[],
514 "trailing":[],
515 "line_number":14
518 "function_type_parameter_list":{"kind":"missing"},
519 "function_left_paren":{
520 "kind":"token",
521 "token":{
522 "kind":"(",
523 "text":"(",
524 "offset":246,
525 "leading_width":0,
526 "width":1,
527 "trailing_width":0,
528 "leading":[],
529 "trailing":[],
530 "line_number":14
533 "function_parameter_list":{"kind":"missing"},
534 "function_right_paren":{
535 "kind":"token",
536 "token":{
537 "kind":")",
538 "text":")",
539 "offset":247,
540 "leading_width":0,
541 "width":1,
542 "trailing_width":1,
543 "leading":[],
544 "trailing":[{"kind":"whitespace","text":" ","offset":248,"width":1}],
545 "line_number":14
548 "function_colon":{"kind":"missing"},
549 "function_type":{"kind":"missing"},
550 "function_where_clause":{"kind":"missing"}
552 "methodish_function_body":{
553 "kind":"compound_statement",
554 "compound_left_brace":{
555 "kind":"token",
556 "token":{
557 "kind":"{",
558 "text":"{",
559 "offset":249,
560 "leading_width":0,
561 "width":1,
562 "trailing_width":1,
563 "leading":[],
564 "trailing":[{"kind":"end_of_line","text":"\n","offset":250,"width":1}],
565 "line_number":14
568 "compound_statements":{"kind":"missing"},
569 "compound_right_brace":{
570 "kind":"token",
571 "token":{
572 "kind":"}",
573 "text":"}",
574 "offset":251,
575 "leading_width":2,
576 "width":1,
577 "trailing_width":1,
578 "leading":[{"kind":"whitespace","text":" ","offset":251,"width":2}],
579 "trailing":[{"kind":"end_of_line","text":"\n","offset":254,"width":1}],
580 "line_number":15
584 "methodish_semicolon":{"kind":"missing"}
587 "kind":"property_declaration",
588 "property_attribute_spec":{"kind":"missing"},
589 "property_modifiers":{
590 "kind":"list",
591 "elements":[
593 "kind":"token",
594 "token":{
595 "kind":"public",
596 "text":"public",
597 "offset":255,
598 "leading_width":29,
599 "width":6,
600 "trailing_width":1,
601 "leading":[
602 {"kind":"end_of_line","text":"\n","offset":255,"width":1},
603 {"kind":"whitespace","text":" ","offset":256,"width":2},
605 "kind":"single_line_comment",
606 "text":"// no change in parsing",
607 "offset":258,
608 "width":23
610 {"kind":"end_of_line","text":"\n","offset":281,"width":1},
611 {"kind":"whitespace","text":" ","offset":282,"width":2}
613 "trailing":[{"kind":"whitespace","text":" ","offset":290,"width":1}],
614 "line_number":18
619 "property_type":{
620 "kind":"simple_type_specifier",
621 "simple_type_specifier":{
622 "kind":"token",
623 "token":{
624 "kind":"name",
625 "text":"meaninglessword1",
626 "offset":291,
627 "leading_width":0,
628 "width":16,
629 "trailing_width":1,
630 "leading":[],
631 "trailing":[{"kind":"whitespace","text":" ","offset":307,"width":1}],
632 "line_number":18
636 "property_declarators":{
637 "kind":"list",
638 "elements":[
640 "kind":"list_item",
641 "list_item":{
642 "kind":"property_declarator",
643 "property_name":{"kind":"missing"},
644 "property_initializer":{"kind":"missing"}
646 "list_separator":{"kind":"missing"}
650 "property_semicolon":{"kind":"missing"}
653 "kind":"error",
654 "error_error":{
655 "kind":"token",
656 "token":{
657 "kind":"name",
658 "text":"meaninglessword2",
659 "offset":308,
660 "leading_width":0,
661 "width":16,
662 "trailing_width":1,
663 "leading":[],
664 "trailing":[{"kind":"whitespace","text":" ","offset":324,"width":1}],
665 "line_number":18
670 "kind":"methodish_declaration",
671 "methodish_attribute":{"kind":"missing"},
672 "methodish_function_decl_header":{
673 "kind":"function_declaration_header",
674 "function_modifiers":{"kind":"missing"},
675 "function_keyword":{
676 "kind":"token",
677 "token":{
678 "kind":"function",
679 "text":"function",
680 "offset":325,
681 "leading_width":0,
682 "width":8,
683 "trailing_width":1,
684 "leading":[],
685 "trailing":[{"kind":"whitespace","text":" ","offset":333,"width":1}],
686 "line_number":18
689 "function_name":{
690 "kind":"token",
691 "token":{
692 "kind":"name",
693 "text":"f",
694 "offset":334,
695 "leading_width":0,
696 "width":1,
697 "trailing_width":0,
698 "leading":[],
699 "trailing":[],
700 "line_number":18
703 "function_type_parameter_list":{"kind":"missing"},
704 "function_left_paren":{
705 "kind":"token",
706 "token":{
707 "kind":"(",
708 "text":"(",
709 "offset":335,
710 "leading_width":0,
711 "width":1,
712 "trailing_width":0,
713 "leading":[],
714 "trailing":[],
715 "line_number":18
718 "function_parameter_list":{"kind":"missing"},
719 "function_right_paren":{
720 "kind":"token",
721 "token":{
722 "kind":")",
723 "text":")",
724 "offset":336,
725 "leading_width":0,
726 "width":1,
727 "trailing_width":1,
728 "leading":[],
729 "trailing":[{"kind":"whitespace","text":" ","offset":337,"width":1}],
730 "line_number":18
733 "function_colon":{"kind":"missing"},
734 "function_type":{"kind":"missing"},
735 "function_where_clause":{"kind":"missing"}
737 "methodish_function_body":{
738 "kind":"compound_statement",
739 "compound_left_brace":{
740 "kind":"token",
741 "token":{
742 "kind":"{",
743 "text":"{",
744 "offset":338,
745 "leading_width":0,
746 "width":1,
747 "trailing_width":1,
748 "leading":[],
749 "trailing":[{"kind":"end_of_line","text":"\n","offset":339,"width":1}],
750 "line_number":18
753 "compound_statements":{"kind":"missing"},
754 "compound_right_brace":{
755 "kind":"token",
756 "token":{
757 "kind":"}",
758 "text":"}",
759 "offset":340,
760 "leading_width":2,
761 "width":1,
762 "trailing_width":1,
763 "leading":[{"kind":"whitespace","text":" ","offset":340,"width":2}],
764 "trailing":[{"kind":"end_of_line","text":"\n","offset":343,"width":1}],
765 "line_number":19
769 "methodish_semicolon":{"kind":"missing"}
773 "classish_body_right_brace":{
774 "kind":"token",
775 "token":{
776 "kind":"}",
777 "text":"}",
778 "offset":344,
779 "leading_width":1,
780 "width":1,
781 "trailing_width":1,
782 "leading":[{"kind":"end_of_line","text":"\n","offset":344,"width":1}],
783 "trailing":[{"kind":"end_of_line","text":"\n","offset":346,"width":1}],
784 "line_number":21
790 "kind":"end_of_file",
791 "end_of_file_token":{
792 "kind":"token",
793 "token":{
794 "kind":"end_of_file",
795 "text":"",
796 "offset":347,
797 "leading_width":0,
798 "width":0,
799 "trailing_width":0,
800 "leading":[],
801 "trailing":[],
802 "line_number":22
809 "program_text":"<?hh\n\nclass C {\n\n // 'sta' becomes error trivia\n public sta function f() {\n }\n\n // 'meaninglessword' becomes error trivia\n public static meaninglessword function f() {\n }\n\n // no change in parsing\n public meaninglessword static function f() {\n }\n\n // no change in parsing\n public meaninglessword1 meaninglessword2 function f() {\n }\n\n}\n",
810 "version":"2020-04-14-0002"