Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52387 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61647 invoked from network); 16 May 2011 12:30:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2011 12:30:58 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:39604] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/A5-26716-EF811DD4 for ; Mon, 16 May 2011 08:30:55 -0400 Received: by eyf5 with SMTP id 5so1289920eyf.29 for ; Mon, 16 May 2011 05:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=cOwYoKuj1dq+iOZP43syi9fjn0zNUuv3ScQl/9fyDnk=; b=iVkheTtSpY0dSEeMcdg5HbZfe+V4SKHMStpduEfDA/L4ldvwmyr1m827JzGDNsJK6D z8PrjKj0wN6oeEHXz0oJQYALbnQI3S5z9MUUxKnUYDaGLcBHRIe2SNQXtdtYFkBr7UOk 5MYgjPkHidY3Ayrsj9ymAQ+RgIO4zCyCT6gyY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=empjomTdpqfLG7PUXGqfYISTdOE2O/IXrp87hKbsnn1hwIkafgyWq7W+30QV7N8Dfe KVWOY620uLjk7EFVSy3l7HkHBdtEmPL1UWkCu2ku/M7eD9jDV/qutqKqIai/89GMmFz7 dqswSKsOLDwh+1lXmX039+qSAUMzfQRlvd2/I= MIME-Version: 1.0 Received: by 10.14.32.66 with SMTP id n42mr1619018eea.84.1305549051828; Mon, 16 May 2011 05:30:51 -0700 (PDT) Sender: tyra3l@gmail.com Received: by 10.14.37.13 with HTTP; Mon, 16 May 2011 05:30:50 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 May 2011 14:30:50 +0200 X-Google-Sender-Auth: p_kdY8pG-eU0ovbFgGck6NDziAg Message-ID: To: Felipe Pena Cc: internals Content-Type: multipart/alternative; boundary=00235451e67878991d04a363d3ed Subject: Re: [PHP-DEV] [RFC] Improved parser error message From: info@tyrael.hu (Ferenc Kovacs) --00235451e67878991d04a363d3ed Content-Type: text/plain; charset=UTF-8 On Mon, May 16, 2011 at 2:15 PM, Felipe Pena wrote: > Hi all, > As I have proposed previously in an old thread... What about we name all > the > tokens to have an improved parser error message? (i.e. anymore > T_PAAMAYIM_NEKUDOTAYIM, T_DOLLAR_OPEN_CURLY_BRACES in the messages etc) > > Some examples: > > $ sapi/cli/php -r 'function ""' > Patched: > Parse error: syntax error, unexpected quoted-string, expecting identifier > or > '(' in Command line code on line 1 > > Current: > Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting > T_STRING or '(' in Command line code on line 1 > > > $ sapi/cli/php -r 'echo ::a;' > Patched: > Parse error: syntax error, unexpected :: in Command line code on line 1 > > Current: > Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in Command > line > code on line 1 > > Other examples and patch at: > https://wiki.php.net/rfc/improved-parser-error-message > > Any thoughts? > > Thanks. > > -- > Regards, > Felipe Pena > +1 do you think that this could cause some kind of BC? I don't think that anybody out there parses the tokens as is, but there are crazy people. :) the other thing that I can imagine that the developers will be surprised that they are getting meaningful error messages, but I think they can live with that. :) Tyrael --00235451e67878991d04a363d3ed--