Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66584 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38232 invoked from network); 11 Mar 2013 12:24:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2013 12:24:38 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.175 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.175 mail-we0-f175.google.com Received: from [74.125.82.175] ([74.125.82.175:44057] helo=mail-we0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/1A-09030-50DCD315 for ; Mon, 11 Mar 2013 07:24:38 -0500 Received: by mail-we0-f175.google.com with SMTP id x8so3453655wey.20 for ; Mon, 11 Mar 2013 05:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=CqwDcbJO0lPkTPDGiR3ij5SAjN0nFTsylY2M8tTsXg4=; b=reyq1RKvvHjY6WekDjbRagKxt2VnPZpIIC4orKk/NKAdJgFeD1heD6l67lVuyLlV23 olUAgJcCU7SF+832prfoodjzqHjNqLyJyX4g1jqQlMmL9NSn42xn+weKx1rP2jnLG223 o0OuAYxAVLzCHqaSV+WIhOeeik9efxFP/CNt2AdgYP4I8fYlDOcuZn6DUQ2FBk3a9Los BFWuYueZucszKS2AqJykjRrMsbOftDQpFvz3cnTYtJIDb/+c9B/qfXo2yOE1fJb9YyKl LScnb1I6k6+XclIZvgfcg3al28HBQcscU9MUpIl/KFzLIKjvcDAUxtcg45ZMJEJy8Zke Xoug== X-Received: by 10.194.87.229 with SMTP id bb5mr18552481wjb.32.1363004672688; Mon, 11 Mar 2013 05:24:32 -0700 (PDT) Received: from [192.168.1.26] (54.Red-81-38-89.dynamicIP.rima-tde.net. [81.38.89.54]) by mx.google.com with ESMTPS id k5sm16818066wiy.5.2013.03.11.05.24.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Mar 2013 05:24:31 -0700 (PDT) Message-ID: <513DCBBF.8020809@gmail.com> Date: Mon, 11 Mar 2013 13:19:11 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Eric James Michael Ritz CC: internals@lists.php.net References: <513DBDD4.3010804@gmail.com> In-Reply-To: <513DBDD4.3010804@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Double-Colon Always Follows the 'parent' Keyword? From: keisial@gmail.com (=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=) On 11/03/13 12:19, Eric James Michael Ritz wrote: > Hello everyone, > > I have a question about the internals of PHP, but this is not about > advancing the development of the language, so I apologize if this is > on the wrong list. I am choosing to post to this list because I > believe the people here are most qualified to answer my question. > > This is what I want to know: Is there any valid situation in PHP where > the ‘parent’ keyword is not followed by the scope-resolution operator? > I am asking to help me decide on the best way to fix a bug for > php-mode[1] for GNU Emacs. Consider these three lines: > > echo $parent; > echo parent::$foo; > echo $this->parent; > > Emacs correctly highlights the first ‘parent’ as a variable name. It > also highlights ‘parent’ in the second line as a keyword, as it > should. But in the third line it treats ‘parent’ as a keyword instead > of a variable and applies the wrong syntax formatting. > > My idea to fix this problem is to only treat ‘parent’ as a keyword if > the scope-resolution operator immediately follows it. But before > doing that I want to know whether or not that is true. So is there > are valid situation where the keyword ‘parent’ does not have ‘::’ > after it? > > Thank you in advanced for any advice and help. Hello Eric Wouldn't it be simpler to check that parent if preceded by whitespace/brackets? Checking if it's followed by the paamayim nekudotayim, seems also ok.