Re: [PHP-DEV] Improving output of syntax errors

2020-07-05 Thread Rowan Tommins
On 29/06/2020 10:42, Claude Pache wrote: Another way to give the programmer the appropriate information, is replacing “quoted string” with “single-quoted string” and “double-quoted string”. And while I am thinking about it: a case that tends to cause divergent squint is: unexpected '"', which

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Rowan Tommins
On Mon, 29 Jun 2020 at 10:42, Claude Pache wrote: > > At this point, I don’t feel strongly, because currently, when I see > “unexpected (T_CONSTANT_ENCAPSED_STRING)”, > my automatism is not looking for a string with specific quote style (which > is not evident by looking at four consecutive

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Claude Pache
> Le 29 juin 2020 à 10:29, Rowan Tommins a écrit : > > > I did actually have strings matching the quote marks used in an earlier > version of the patch, but dropped it partly to simplify the implementation > - because it sometimes truncates strings, it can't just use the real > quotes, but has

Re: [PHP-DEV] Improving output of syntax errors

2020-06-29 Thread Rowan Tommins
Hi Claude, On Mon, 29 Jun 2020 at 07:27, Claude Pache wrote: > > > > As a special-case, quoted strings show the string's *content* in double > quotes, e.g. 'unexpected quoted string "foo" ...' rather than 'unexpected > quoted string ""foo"" ...' or 'unexpected quoted string "'foo'" ...'. > > Fo

Re: [PHP-DEV] Improving output of syntax errors

2020-06-28 Thread Claude Pache
> As a special-case, quoted strings show the string's *content* in double > quotes, e.g. 'unexpected quoted string "foo" ...' rather than 'unexpected > quoted string ""foo"" ...' or 'unexpected quoted string "'foo'" ...'. For me, in this case, you have dropped the wrong pair of quotes. That i

Re: [PHP-DEV] Improving output of syntax errors

2020-06-28 Thread Joe Watkins
Nicely done. No need for an RFC. Thanks. On Sunday, 28 June 2020, Stanislav Malyshev wrote: > Hi! > > > For more examples, see: > > https://rwec.co.uk/x/php-parse-errors/comparison.html > > > > The patch can be reviewed at: https://github.com/php/php-src/pull/5722 > > I think this is great, th

Re: [PHP-DEV] Improving output of syntax errors

2020-06-28 Thread Stanislav Malyshev
Hi! > For more examples, see: > https://rwec.co.uk/x/php-parse-errors/comparison.html > > The patch can be reviewed at: https://github.com/php/php-src/pull/5722 I think this is great, thanks for implementing it! > I am happy to post a small RFC if people think this requires a vote. > > Any oth

[PHP-DEV] Improving output of syntax errors

2020-06-28 Thread Rowan Tommins
Hi all, During the discussion of "T_PAAMAYIM_NEKUDOTAYIM", there was broad agreement that internal token names should not be included in errors shown to users. I now have an implementation of this. Note that we currently only customise the token descriptions placed into Bison's hard-coded te