Re: Potential flaw in grammar
| From: | Christoph Becker | Date: | Tue, 26 Aug 2014 14:36:13 +0000 |
| Subject: | Re: Potential flaw in grammar | ||
| References: | 1 | Groups: | php.standards |
| Request: | Send a blank email to standards-+get-405@lists.php.net to get a copy of this message | ||
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