Re: Potential flaw in grammar
[email protected] (Christoph Becker)
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
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