[php-langspec][Issue #232] - Describe list expression differently to remove some constraits
| From: | noreply@php.net | Date: | Sat, 22 Dec 2018 00:57:37 +0000 |
| Subject: | [php-langspec][Issue #232] - Describe list expression differently to remove some constraits | ||
| Groups: | php.standards | ||
| Request: | Send a blank email to standards-+get-1366@lists.php.net to get a copy of this message | ||
You can view the Issue on github:
https://github.com/php/php-langspec/issues/232
Opened By: zhujinxuan
Issue Description:
Hi, I think it is perhaps better to document the
list-expression in this way, which
automatically ensures there is at least one valid element:
```
list-intrinsic:
list ( list-expression-list )
list-expression-list:
commas? list-element commas?
commas? list-element , list-expression-list?
commas:
,
, commas
list-element
expression => list-or-variable
list-or-variable
```
Then we can remove the following constraints documentation:
> At least one of the elements of the list-expression-list must be non-empty.
I think this makes the document a bit neater and parser can write the list parser just by reading
the expression.