Fix precedence of "await" and some erroneous test cases
Summary:
While working on getting the full-fidelity parser behaviour for -> correct, I noticed that one of the test cases was wrong in two ways. The test was intended to determine whether the "array" built-in was being parsed correctly, but the case was wrong; it was:
await $x->array( ... )
The intention of the test was to have the right side of the -> parsed as an expression, but a name immediately following -> should always be parsed as the member of the receiver. That is, this should be
await ( ($x->array) ( ... ) )
and not
await ( $x-> ( array ( ... ) ) )
I changed the -> to a . so that we do not have this problem.
Second, the "await" operator should be the lowest precedence operator, but for some reason which escapes me, I had it on the precedence list with casts, which is wrong. This meant that another test case was getting the wrong answer:
await $x + $y
should be parsed as
await ($x + $y)
and not
(await $x) + $y
I changed the precedence and fixed the test case.
At some point we should get the precedence rules in a table in the spec, but that can come later.
Reviewed By: jamesjwu
Differential Revision:
D3753588
fbshipit-source-id:
57d140fd1da4461f63fab5a84b668a626e9e4a1a