Fix code for parsing "new" expressions
Summary:
Parsing object creation expressions was a bit messed up.
I have determined what the rule is in Hack for the operand of a "new"; it must be parent, self, static, a qualified name, a variable, or a use of ->, ?->, [], {} or ::, I've updated the spec with this information and added a comment to the code.
The most expedient thing to do here is to parse any expression, but that doesn't quite work because in "new x()", "x()" is an expression! So what we do is parse any expression with the precedence of "new". Since () is of lower precedence than new, "x()" will be parsed as "x".
We'll then add an error checker to a later pass in another diff.
Reviewed By: jopamer
Differential Revision:
D3757834
fbshipit-source-id:
fce9d93e51dd5d0af1ff9c22b7470efacb3c9092