Re: Potential flaw in grammar

[email protected] (ken Koch)
Newsgroups php.standards
Message-ID <CAJqvgTyMo3YuimpoBBF64CMNrbpOrXn-kLHmaT9JVhhT33-WAw@mail.gmail.com>
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 <[email protected]> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.