facebookarchive / hack-langspec

The official Hack Language specification.
http://hacklang.org
Other
172 stars 48 forks source link

use clause grammar is incorrect for "simple" clauses #103

Open ericlippert opened 7 years ago

ericlippert commented 7 years ago

The grammar in Ch 20 for "simple" use clauses is incorrect. It states that

use function \N\F, \N\G;

is legal, but

use function \N\F, function \N\G;

is illegal. Though this IS illegal in PHP, in Hack we wish it to be legal.

The spec should be updated to say so. The grammar can be emended by changing

use namespace-use-kindopt  namespace-use-clauses  ;

to

use namespace-use-kind-clauses  ;