Be more restrictive about statements at toplevel in strict mode
commitd3adbdc63770dac1c80c2c6fcf5fbb5363cf5564
authorJosh Watzman <jwatzman@fb.com>
Tue, 25 Mar 2014 21:51:43 +0000 (25 14:51 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 27 Mar 2014 21:02:31 +0000 (27 14:02 -0700)
treea777ce841995041f9a96646b076d65789844604e
parentda2284b9836a2480272039656e658d18e0f823d6
Be more restrictive about statements at toplevel in strict mode

We weren't checking for certain types of toplevel statements.
We also need to consume semicolons since occasionally people do `class C
{ ... };` which we should admit even in strict. Also we were failing to
consume the semicolon after typedefs.

Closes #2144

Reviewed By: @gabelevi

Differential Revision: D1239786
hphp/hack/src/parsing/parser_hack.ml
hphp/hack/test/more_tests/strict_no_statements2.php [new file with mode: 0644]
hphp/hack/test/more_tests/strict_no_statements2.php.exp [new file with mode: 0644]
hphp/hack/test/more_tests/strict_no_statements3.php [new file with mode: 0644]
hphp/hack/test/more_tests/strict_no_statements3.php.exp [new file with mode: 0644]
hphp/hack/test/more_tests/strict_no_statements4.php [new file with mode: 0644]
hphp/hack/test/more_tests/strict_no_statements4.php.exp [new file with mode: 0644]