Disallow `$` as a unary operator unless as part of a variable variable variable.
commite66a66e9b82b2427d7a762fab702ca84d2519803
authorWill Pitts (they/them) <wipi@fb.com>
Tue, 17 Jul 2018 00:13:06 +0000 (16 17:13 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 17 Jul 2018 00:28:02 +0000 (16 17:28 -0700)
tree48c13c4248c58861d1e7369ede2d469c9dfe7ae2
parent66d3949198e7e38bec7a4176b4e4af12be2daead
Disallow `$` as a unary operator unless as part of a variable variable variable.

Summary: The FFP is allowing constructs such as `$-$y`, which are pretty nonsensical.  This change makes it so that `$` can only be followed by another `$` or a variable name.

Reviewed By: kmeht, jamesjwu

Differential Revision: D8813181

fbshipit-source-id: 8edb36cfe6648ab93c7ab4b562f0f8c6f5c662c6
hphp/hack/src/parser/full_fidelity_parser_errors.ml
hphp/hack/src/parser/full_fidelity_syntax_error.ml
hphp/hack/src/parser/full_fidelity_syntax_error.mli
hphp/hack/test/full_fidelity/cases/test_invalid_unary_expressions.php [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/test_invalid_unary_expressions.php.errors.exp [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/test_invalid_unary_expressions.php.sexp.exp [new file with mode: 0644]