Re: Potential flaw in grammar
| From: | ken Koch | Date: | Tue, 26 Aug 2014 14:39:17 +0000 |
| Subject: | Re: Potential flaw in grammar | ||
| References: | 1 2 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-406@lists.php.net to get a copy of this message | ||
Chris,
Ahh, makes sense, i figured i couldn't be the first to notice that. Thanks!
- Ken
On Tue, Aug 26, 2014 at 10:36 AM, Christoph Becker <cmbecker69@gmx.de> wrote:
> ken Koch wrote:
>
>> I've been looking over the grammar to test out a parser I've been
>> building. I think i may have discovered a small flaw in the grammar
>> definition for string literals.
>>
>> The problem is in the definition of heredoc-string-literal and
>> nowdoc-string literal. The relevant definitions:
>>
>> from
>> https://github.com/php/php-langspec/blob/master/spec/19-grammar.md#string-literals:
>>
>> heredoc-string-literal::
>> hd-start-identifier new-line hd-char-sequenceopt new-line
>> hd-end-identifier ;opt new-line
>>
>> hd-start-identifier::
>> name
>>
>> hd-end-identifier::
>> name
>>
>> nowdoc-string-literal::
>> hd-start-identifier ' new-line hd-char-sequenceopt new-line
>> hd-end-identifier ;opt new-line
>
> That's a problem with the rendering of the markdown (maybe the markdown
> needs some escaping); the raw markdown[1] seems to be correct.
>
> A similar problem can be seen for the relational operators[2]--some of
> them seem to be missing.
>
> [1]
>
> <https://raw.githubusercontent.com/php/php-langspec/master/spec/19-grammar.md>
> [2]
>
> <https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#user-content-relational-operators>
>
> --
> Christoph M. Becker
>