Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50064 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42254 invoked from network); 1 Nov 2010 20:50:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2010 20:50:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.214.170 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:43846] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/3D-10621-5082FCC4 for ; Mon, 01 Nov 2010 15:50:13 -0500 Received: by iwn9 with SMTP id 9so6392547iwn.29 for ; Mon, 01 Nov 2010 13:50:11 -0700 (PDT) Received: by 10.231.31.196 with SMTP id z4mr3339868ibc.81.1288644610860; Mon, 01 Nov 2010 13:50:10 -0700 (PDT) Received: from Rasmus-Lerdorfs-MacBook-Pro.local ([66.201.49.170]) by mx.google.com with ESMTPS id d21sm5654100ibg.21.2010.11.01.13.50.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 01 Nov 2010 13:50:09 -0700 (PDT) Message-ID: <4CCF27FF.1000305@lerdorf.com> Date: Mon, 01 Nov 2010 13:50:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Felipe Pena CC: internals@lists.php.net References: <4CCB6B21.1070708@codeangel.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON From: rasmus@lerdorf.com (Rasmus Lerdorf) On 11/1/10 1:47 PM, Felipe Pena wrote: > 2010/11/1 Richard Lynch > >> On Fri, October 29, 2010 7:47 pm, admin wrote: >>> WTF is T_PAAMAYIM_NEKUDOTAYIM? >>> >>> This has to be THE most asked question by new php developers when they >>> come across it. Can we please change the token name to T_DOUBLE_COLON >>> so I don't have to hear about it constantly? >>> >>> Those that disagree don't do enough PHP support to know how often it >>> is >>> asked. it's worth it. >> >> -1 >> >> > Instead of renaming the token, I prefer to associate a literal string to > each token, to have a legible error message, without the T_ being shown. > > For example, we could use in the Bison grammar file: > %token T_PAAMAYIM_NEKUDOTAYIM "::" > > So that the error message become: > > $ sapi/cli/php -r '::' > Parse error: syntax error, unexpected :: in Command line code on line 1 > > Instead of the known "unexpected T_PAAMAYIM_NEKUDOTAYIM" one. Years and years ago that was the intent. I didn't think there was a clean way to do that in yacc though. -Rasmus