expressions like vec[0] should be interpreted as subscript in php files
commitc0e9b84a535719f065295f4b87f616e63b0e1bb3
authorCatherine Gasnier <catg@fb.com>
Tue, 30 Jan 2018 18:04:11 +0000 (30 10:04 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 30 Jan 2018 18:09:47 +0000 (30 10:09 -0800)
treec4aef58a3b97410c13a29d59cd0a82ce54f001b1
parentfe9ffb6ea92d5a837f849e10b66984e2af6e924e
expressions like vec[0] should be interpreted as subscript in php files

Summary:
Hack keywords vec, keyset and dict followed by square brackets should
be interpreted as subscript of constants in php files.

This fixes tests hphp/test/slow/create_function/file-mode.php.

The fix is at 2 levels: ff_parser_errors and ff_ast, aka the module of all the
hacks.

Differential Revision: D6748290

fbshipit-source-id: b1512e5a2822a9b75e471ac798c2aa12d9b934a7
hphp/hack/src/parser/full_fidelity_ast.ml
hphp/hack/src/parser/full_fidelity_lexer.ml
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/test/hackc_failing_tests_slow
hphp/test/slow/dict/hh-only1.php.expectregex
hphp/test/slow/keyset/hh-only1.php.expectregex
hphp/test/slow/vec/hh-only1.php.expectregex