Delete provisional syntax for capabilities
[hiphop-php.git] / hphp / hack / test / full_fidelity / cases / test_expression_errors.php.json.exp
blob4404c0d9b730be2f3f42780fa2687d9731c4b652
2 "parse_tree":{
3 "kind":"script",
4 "script_declarations":{
5 "kind":"list",
6 "elements":[
8 "kind":"markup_section",
9 "markup_hashbang":{
10 "kind":"token",
11 "token":{
12 "kind":"hashbang",
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":"function_declaration",
57 "function_attribute_spec":{"kind":"missing"},
58 "function_declaration_header":{
59 "kind":"function_declaration_header",
60 "function_modifiers":{"kind":"missing"},
61 "function_keyword":{
62 "kind":"token",
63 "token":{
64 "kind":"function",
65 "text":"function",
66 "offset":5,
67 "leading_width":1,
68 "width":8,
69 "trailing_width":1,
70 "leading":[{"kind":"end_of_line","text":"\n","offset":5,"width":1}],
71 "trailing":[{"kind":"whitespace","text":" ","offset":14,"width":1}],
72 "line_number":3
75 "function_name":{
76 "kind":"token",
77 "token":{
78 "kind":"name",
79 "text":"f",
80 "offset":15,
81 "leading_width":0,
82 "width":1,
83 "trailing_width":0,
84 "leading":[],
85 "trailing":[],
86 "line_number":3
89 "function_type_parameter_list":{"kind":"missing"},
90 "function_left_paren":{
91 "kind":"token",
92 "token":{
93 "kind":"(",
94 "text":"(",
95 "offset":16,
96 "leading_width":0,
97 "width":1,
98 "trailing_width":0,
99 "leading":[],
100 "trailing":[],
101 "line_number":3
104 "function_parameter_list":{
105 "kind":"list",
106 "elements":[
108 "kind":"list_item",
109 "list_item":{
110 "kind":"parameter_declaration",
111 "parameter_attribute":{"kind":"missing"},
112 "parameter_visibility":{"kind":"missing"},
113 "parameter_call_convention":{"kind":"missing"},
114 "parameter_type":{"kind":"missing"},
115 "parameter_name":{
116 "kind":"token",
117 "token":{
118 "kind":"variable",
119 "text":"$x",
120 "offset":17,
121 "leading_width":0,
122 "width":2,
123 "trailing_width":0,
124 "leading":[],
125 "trailing":[],
126 "line_number":3
129 "parameter_default_value":{"kind":"missing"}
131 "list_separator":{"kind":"missing"}
135 "function_right_paren":{
136 "kind":"token",
137 "token":{
138 "kind":")",
139 "text":")",
140 "offset":19,
141 "leading_width":0,
142 "width":1,
143 "trailing_width":1,
144 "leading":[],
145 "trailing":[{"kind":"whitespace","text":" ","offset":20,"width":1}],
146 "line_number":3
149 "function_capability":{"kind":"missing"},
150 "function_colon":{"kind":"missing"},
151 "function_type":{"kind":"missing"},
152 "function_where_clause":{"kind":"missing"}
154 "function_body":{
155 "kind":"compound_statement",
156 "compound_left_brace":{
157 "kind":"token",
158 "token":{
159 "kind":"{",
160 "text":"{",
161 "offset":21,
162 "leading_width":0,
163 "width":1,
164 "trailing_width":1,
165 "leading":[],
166 "trailing":[{"kind":"end_of_line","text":"\n","offset":22,"width":1}],
167 "line_number":3
170 "compound_statements":{
171 "kind":"list",
172 "elements":[
174 "kind":"return_statement",
175 "return_keyword":{
176 "kind":"token",
177 "token":{
178 "kind":"return",
179 "text":"return",
180 "offset":23,
181 "leading_width":2,
182 "width":6,
183 "trailing_width":1,
184 "leading":[{"kind":"whitespace","text":" ","offset":23,"width":2}],
185 "trailing":[{"kind":"whitespace","text":" ","offset":31,"width":1}],
186 "line_number":4
189 "return_expression":{
190 "kind":"subscript_expression",
191 "subscript_receiver":{
192 "kind":"variable",
193 "variable_expression":{
194 "kind":"token",
195 "token":{
196 "kind":"variable",
197 "text":"$x",
198 "offset":32,
199 "leading_width":0,
200 "width":2,
201 "trailing_width":0,
202 "leading":[],
203 "trailing":[],
204 "line_number":4
208 "subscript_left_bracket":{
209 "kind":"token",
210 "token":{
211 "kind":"{",
212 "text":"{",
213 "offset":34,
214 "leading_width":0,
215 "width":1,
216 "trailing_width":0,
217 "leading":[],
218 "trailing":[],
219 "line_number":4
222 "subscript_index":{
223 "kind":"literal",
224 "literal_expression":{
225 "kind":"token",
226 "token":{
227 "kind":"decimal_literal",
228 "text":"123",
229 "offset":35,
230 "leading_width":0,
231 "width":3,
232 "trailing_width":0,
233 "leading":[],
234 "trailing":[],
235 "line_number":4
239 "subscript_right_bracket":{
240 "kind":"token",
241 "token":{
242 "kind":"}",
243 "text":"}",
244 "offset":38,
245 "leading_width":0,
246 "width":1,
247 "trailing_width":0,
248 "leading":[],
249 "trailing":[],
250 "line_number":4
254 "return_semicolon":{
255 "kind":"token",
256 "token":{
257 "kind":";",
258 "text":";",
259 "offset":39,
260 "leading_width":0,
261 "width":1,
262 "trailing_width":39,
263 "leading":[],
264 "trailing":[
265 {"kind":"whitespace","text":" ","offset":40,"width":1},
267 "kind":"single_line_comment",
268 "text":"// error: deprecated subscript syntax",
269 "offset":41,
270 "width":37
272 {"kind":"end_of_line","text":"\n","offset":78,"width":1}
274 "line_number":4
280 "compound_right_brace":{
281 "kind":"token",
282 "token":{
283 "kind":"}",
284 "text":"}",
285 "offset":79,
286 "leading_width":0,
287 "width":1,
288 "trailing_width":1,
289 "leading":[],
290 "trailing":[{"kind":"end_of_line","text":"\n","offset":80,"width":1}],
291 "line_number":5
297 "kind":"function_declaration",
298 "function_attribute_spec":{"kind":"missing"},
299 "function_declaration_header":{
300 "kind":"function_declaration_header",
301 "function_modifiers":{"kind":"missing"},
302 "function_keyword":{
303 "kind":"token",
304 "token":{
305 "kind":"function",
306 "text":"function",
307 "offset":81,
308 "leading_width":1,
309 "width":8,
310 "trailing_width":1,
311 "leading":[{"kind":"end_of_line","text":"\n","offset":81,"width":1}],
312 "trailing":[{"kind":"whitespace","text":" ","offset":90,"width":1}],
313 "line_number":7
316 "function_name":{
317 "kind":"token",
318 "token":{
319 "kind":"name",
320 "text":"g",
321 "offset":91,
322 "leading_width":0,
323 "width":1,
324 "trailing_width":0,
325 "leading":[],
326 "trailing":[],
327 "line_number":7
330 "function_type_parameter_list":{"kind":"missing"},
331 "function_left_paren":{
332 "kind":"token",
333 "token":{
334 "kind":"(",
335 "text":"(",
336 "offset":92,
337 "leading_width":0,
338 "width":1,
339 "trailing_width":0,
340 "leading":[],
341 "trailing":[],
342 "line_number":7
345 "function_parameter_list":{
346 "kind":"list",
347 "elements":[
349 "kind":"list_item",
350 "list_item":{
351 "kind":"parameter_declaration",
352 "parameter_attribute":{"kind":"missing"},
353 "parameter_visibility":{"kind":"missing"},
354 "parameter_call_convention":{"kind":"missing"},
355 "parameter_type":{"kind":"missing"},
356 "parameter_name":{
357 "kind":"token",
358 "token":{
359 "kind":"variable",
360 "text":"$a",
361 "offset":93,
362 "leading_width":0,
363 "width":2,
364 "trailing_width":0,
365 "leading":[],
366 "trailing":[],
367 "line_number":7
370 "parameter_default_value":{"kind":"missing"}
372 "list_separator":{
373 "kind":"token",
374 "token":{
375 "kind":",",
376 "text":",",
377 "offset":95,
378 "leading_width":0,
379 "width":1,
380 "trailing_width":1,
381 "leading":[],
382 "trailing":[{"kind":"whitespace","text":" ","offset":96,"width":1}],
383 "line_number":7
388 "kind":"list_item",
389 "list_item":{
390 "kind":"parameter_declaration",
391 "parameter_attribute":{"kind":"missing"},
392 "parameter_visibility":{"kind":"missing"},
393 "parameter_call_convention":{"kind":"missing"},
394 "parameter_type":{"kind":"missing"},
395 "parameter_name":{
396 "kind":"token",
397 "token":{
398 "kind":"variable",
399 "text":"$b",
400 "offset":97,
401 "leading_width":0,
402 "width":2,
403 "trailing_width":0,
404 "leading":[],
405 "trailing":[],
406 "line_number":7
409 "parameter_default_value":{"kind":"missing"}
411 "list_separator":{"kind":"missing"}
415 "function_right_paren":{
416 "kind":"token",
417 "token":{
418 "kind":")",
419 "text":")",
420 "offset":99,
421 "leading_width":0,
422 "width":1,
423 "trailing_width":1,
424 "leading":[],
425 "trailing":[{"kind":"whitespace","text":" ","offset":100,"width":1}],
426 "line_number":7
429 "function_capability":{"kind":"missing"},
430 "function_colon":{"kind":"missing"},
431 "function_type":{"kind":"missing"},
432 "function_where_clause":{"kind":"missing"}
434 "function_body":{
435 "kind":"compound_statement",
436 "compound_left_brace":{
437 "kind":"token",
438 "token":{
439 "kind":"{",
440 "text":"{",
441 "offset":101,
442 "leading_width":0,
443 "width":1,
444 "trailing_width":1,
445 "leading":[],
446 "trailing":[{"kind":"end_of_line","text":"\n","offset":102,"width":1}],
447 "line_number":7
450 "compound_statements":{
451 "kind":"list",
452 "elements":[
454 "kind":"return_statement",
455 "return_keyword":{
456 "kind":"token",
457 "token":{
458 "kind":"return",
459 "text":"return",
460 "offset":103,
461 "leading_width":2,
462 "width":6,
463 "trailing_width":1,
464 "leading":[{"kind":"whitespace","text":" ","offset":103,"width":2}],
465 "trailing":[{"kind":"whitespace","text":" ","offset":111,"width":1}],
466 "line_number":8
469 "return_expression":{
470 "kind":"conditional_expression",
471 "conditional_test":{
472 "kind":"variable",
473 "variable_expression":{
474 "kind":"token",
475 "token":{
476 "kind":"variable",
477 "text":"$a",
478 "offset":112,
479 "leading_width":0,
480 "width":2,
481 "trailing_width":1,
482 "leading":[],
483 "trailing":[{"kind":"whitespace","text":" ","offset":114,"width":1}],
484 "line_number":8
488 "conditional_question":{
489 "kind":"token",
490 "token":{
491 "kind":"?",
492 "text":"?",
493 "offset":115,
494 "leading_width":0,
495 "width":1,
496 "trailing_width":1,
497 "leading":[],
498 "trailing":[{"kind":"whitespace","text":" ","offset":116,"width":1}],
499 "line_number":8
502 "conditional_consequence":{"kind":"missing"},
503 "conditional_colon":{
504 "kind":"token",
505 "token":{
506 "kind":":",
507 "text":":",
508 "offset":117,
509 "leading_width":0,
510 "width":1,
511 "trailing_width":1,
512 "leading":[],
513 "trailing":[{"kind":"whitespace","text":" ","offset":118,"width":1}],
514 "line_number":8
517 "conditional_alternative":{
518 "kind":"variable",
519 "variable_expression":{
520 "kind":"token",
521 "token":{
522 "kind":"variable",
523 "text":"$b",
524 "offset":119,
525 "leading_width":0,
526 "width":2,
527 "trailing_width":0,
528 "leading":[],
529 "trailing":[],
530 "line_number":8
535 "return_semicolon":{
536 "kind":"token",
537 "token":{
538 "kind":";",
539 "text":";",
540 "offset":121,
541 "leading_width":0,
542 "width":1,
543 "trailing_width":35,
544 "leading":[],
545 "trailing":[
546 {"kind":"whitespace","text":" ","offset":122,"width":1},
548 "kind":"single_line_comment",
549 "text":"// error: expected elvis operator",
550 "offset":123,
551 "width":33
553 {"kind":"end_of_line","text":"\n","offset":156,"width":1}
555 "line_number":8
561 "compound_right_brace":{
562 "kind":"token",
563 "token":{
564 "kind":"}",
565 "text":"}",
566 "offset":157,
567 "leading_width":0,
568 "width":1,
569 "trailing_width":1,
570 "leading":[],
571 "trailing":[{"kind":"end_of_line","text":"\n","offset":158,"width":1}],
572 "line_number":9
578 "kind":"end_of_file",
579 "end_of_file_token":{
580 "kind":"token",
581 "token":{
582 "kind":"end_of_file",
583 "text":"",
584 "offset":159,
585 "leading_width":0,
586 "width":0,
587 "trailing_width":0,
588 "leading":[],
589 "trailing":[],
590 "line_number":10
597 "program_text":"<?hh\n\nfunction f($x) {\n return $x{123}; // error: deprecated subscript syntax\n}\n\nfunction g($a, $b) {\n return $a ? : $b; // error: expected elvis operator\n}\n",
598 "version":"2020-12-09-0001"