facebookarchive / hack-langspec

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

Field specifier list may have a trailing comma #86

Open ericlippert opened 7 years ago

ericlippert commented 7 years ago

In the type chapter, the grammar for field specifiers of shape types is:

shape-specifier:
  shape ( field-specifier-list-opt )
field-specifier-list:
  field-specifier
  field-specifier-list  ,  field-specifier

But this is allowed to have a trailing comma. Probably the grammar should be something like:

shape-specifier:
  shape ( field-specifier-list-opt )
field-specifier-list:
  field-specifiers  ,-opt
field-specifiers:
  field-specifier
  field-specifiers  ,  field-specifier