Delete provisional syntax for capabilities
[hiphop-php.git] / hphp / hack / test / full_fidelity / cases / test_legal_php.php.json.exp
blob0d3ab9c9e80e01a64e9c7478eda4b58d06cb05a0
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":"$foo",
120 "offset":17,
121 "leading_width":0,
122 "width":4,
123 "trailing_width":1,
124 "leading":[],
125 "trailing":[{"kind":"whitespace","text":" ","offset":21,"width":1}],
126 "line_number":3
129 "parameter_default_value":{
130 "kind":"simple_initializer",
131 "simple_initializer_equal":{
132 "kind":"token",
133 "token":{
134 "kind":"=",
135 "text":"=",
136 "offset":22,
137 "leading_width":0,
138 "width":1,
139 "trailing_width":1,
140 "leading":[],
141 "trailing":[{"kind":"whitespace","text":" ","offset":23,"width":1}],
142 "line_number":3
145 "simple_initializer_value":{
146 "kind":"literal",
147 "literal_expression":{
148 "kind":"token",
149 "token":{
150 "kind":"decimal_literal",
151 "text":"1",
152 "offset":24,
153 "leading_width":0,
154 "width":1,
155 "trailing_width":0,
156 "leading":[],
157 "trailing":[],
158 "line_number":3
164 "list_separator":{
165 "kind":"token",
166 "token":{
167 "kind":",",
168 "text":",",
169 "offset":25,
170 "leading_width":0,
171 "width":1,
172 "trailing_width":1,
173 "leading":[],
174 "trailing":[{"kind":"whitespace","text":" ","offset":26,"width":1}],
175 "line_number":3
180 "kind":"list_item",
181 "list_item":{
182 "kind":"parameter_declaration",
183 "parameter_attribute":{"kind":"missing"},
184 "parameter_visibility":{"kind":"missing"},
185 "parameter_call_convention":{"kind":"missing"},
186 "parameter_type":{"kind":"missing"},
187 "parameter_name":{
188 "kind":"token",
189 "token":{
190 "kind":"variable",
191 "text":"$bar",
192 "offset":27,
193 "leading_width":0,
194 "width":4,
195 "trailing_width":0,
196 "leading":[],
197 "trailing":[],
198 "line_number":3
201 "parameter_default_value":{"kind":"missing"}
203 "list_separator":{"kind":"missing"}
207 "function_right_paren":{
208 "kind":"token",
209 "token":{
210 "kind":")",
211 "text":")",
212 "offset":31,
213 "leading_width":0,
214 "width":1,
215 "trailing_width":1,
216 "leading":[],
217 "trailing":[{"kind":"whitespace","text":" ","offset":32,"width":1}],
218 "line_number":3
221 "function_capability":{"kind":"missing"},
222 "function_colon":{"kind":"missing"},
223 "function_type":{"kind":"missing"},
224 "function_where_clause":{"kind":"missing"}
226 "function_body":{
227 "kind":"compound_statement",
228 "compound_left_brace":{
229 "kind":"token",
230 "token":{
231 "kind":"{",
232 "text":"{",
233 "offset":33,
234 "leading_width":0,
235 "width":1,
236 "trailing_width":51,
237 "leading":[],
238 "trailing":[
239 {"kind":"whitespace","text":" ","offset":34,"width":1},
241 "kind":"single_line_comment",
242 "text":"// missing value is illegal in hack, legal in php",
243 "offset":35,
244 "width":49
246 {"kind":"end_of_line","text":"\n","offset":84,"width":1}
248 "line_number":3
251 "compound_statements":{
252 "kind":"list",
253 "elements":[
255 "kind":"expression_statement",
256 "expression_statement_expression":{
257 "kind":"binary_expression",
258 "binary_left_operand":{
259 "kind":"subscript_expression",
260 "subscript_receiver":{
261 "kind":"variable",
262 "variable_expression":{
263 "kind":"token",
264 "token":{
265 "kind":"variable",
266 "text":"$a",
267 "offset":85,
268 "leading_width":4,
269 "width":2,
270 "trailing_width":0,
271 "leading":[{"kind":"whitespace","text":" ","offset":85,"width":4}],
272 "trailing":[],
273 "line_number":4
277 "subscript_left_bracket":{
278 "kind":"token",
279 "token":{
280 "kind":"[",
281 "text":"[",
282 "offset":91,
283 "leading_width":0,
284 "width":1,
285 "trailing_width":0,
286 "leading":[],
287 "trailing":[],
288 "line_number":4
291 "subscript_index":{"kind":"missing"},
292 "subscript_right_bracket":{
293 "kind":"token",
294 "token":{
295 "kind":"]",
296 "text":"]",
297 "offset":92,
298 "leading_width":0,
299 "width":1,
300 "trailing_width":1,
301 "leading":[],
302 "trailing":[{"kind":"whitespace","text":" ","offset":93,"width":1}],
303 "line_number":4
307 "binary_operator":{
308 "kind":"token",
309 "token":{
310 "kind":"=",
311 "text":"=",
312 "offset":94,
313 "leading_width":0,
314 "width":1,
315 "trailing_width":1,
316 "leading":[],
317 "trailing":[{"kind":"whitespace","text":" ","offset":95,"width":1}],
318 "line_number":4
321 "binary_right_operand":{
322 "kind":"object_creation_expression",
323 "object_creation_new_keyword":{
324 "kind":"token",
325 "token":{
326 "kind":"new",
327 "text":"new",
328 "offset":96,
329 "leading_width":0,
330 "width":3,
331 "trailing_width":1,
332 "leading":[],
333 "trailing":[{"kind":"whitespace","text":" ","offset":99,"width":1}],
334 "line_number":4
337 "object_creation_object":{
338 "kind":"constructor_call",
339 "constructor_call_type":{
340 "kind":"token",
341 "token":{
342 "kind":"name",
343 "text":"E",
344 "offset":100,
345 "leading_width":0,
346 "width":1,
347 "trailing_width":0,
348 "leading":[],
349 "trailing":[],
350 "line_number":4
353 "constructor_call_left_paren":{"kind":"missing"},
354 "constructor_call_argument_list":{"kind":"missing"},
355 "constructor_call_right_paren":{"kind":"missing"}
359 "expression_statement_semicolon":{
360 "kind":"token",
361 "token":{
362 "kind":";",
363 "text":";",
364 "offset":101,
365 "leading_width":0,
366 "width":1,
367 "trailing_width":40,
368 "leading":[],
369 "trailing":[
370 {"kind":"whitespace","text":" ","offset":102,"width":1},
372 "kind":"single_line_comment",
373 "text":"// error2038 in hack, but legal in php",
374 "offset":103,
375 "width":38
377 {"kind":"end_of_line","text":"\n","offset":141,"width":1}
379 "line_number":4
385 "compound_right_brace":{
386 "kind":"token",
387 "token":{
388 "kind":"}",
389 "text":"}",
390 "offset":142,
391 "leading_width":0,
392 "width":1,
393 "trailing_width":1,
394 "leading":[],
395 "trailing":[{"kind":"end_of_line","text":"\n","offset":143,"width":1}],
396 "line_number":5
402 "kind":"end_of_file",
403 "end_of_file_token":{
404 "kind":"token",
405 "token":{
406 "kind":"end_of_file",
407 "text":"",
408 "offset":144,
409 "leading_width":0,
410 "width":0,
411 "trailing_width":0,
412 "leading":[],
413 "trailing":[],
414 "line_number":6
421 "program_text":"<?hh\n\nfunction f($foo = 1, $bar) { // missing value is illegal in hack, legal in php\n $a[] = new E; // error2038 in hack, but legal in php\n}\n",
422 "version":"2020-12-09-0001"