Re: Improving output of syntax errors
| From: | Rowan Tommins | Date: | Sun, 05 Jul 2020 16:49:28 +0000 |
| Subject: | Re: Improving output of syntax errors | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110845@lists.php.net to get a copy of this message | ||
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 you changed into: unexpected token """I've pushed up a new version of the patch with three new special cases: * unexpected token """ -> unexpected double-quote mark * unexpected quoted string "foo" -> unexpected single-quoted string "foo" / unexpected double-quoted string "foo" * unexpected illegal character "_" -> unexpected character 0xNN (where _ is almost certainly a control character, and NN is instead the hexadecimal value of the byte) I've updated the example table with a new column showing those additions: https://rwec.co.uk/x/php-parse-errors/comparison.html If there's no other comments or objections, I would appreciate if someone could merge this in so it can be tested in the next alpha :) Regards, -- Rowan Tommins (né Collins) [IMSoP]