Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20616 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61761 invoked by uid 1010); 27 Nov 2005 01:20:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61745 invoked from network); 27 Nov 2005 01:20:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2005 01:20:29 -0000 X-Host-Fingerprint: 202.81.246.113 246-113.netfront.net Linux 2.4/2.6 Received: from ([202.81.246.113:48902] helo=alanportable2.hklc.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 81/5B-56276-CD909834 for ; Sat, 26 Nov 2005 20:20:29 -0500 Received: from localhost ([127.0.0.1]) by alanportable2.hklc.com with esmtp (Exim 3.36 #1 (Debian)) id 1EgBDt-0006TD-00; Sun, 27 Nov 2005 09:20:57 +0800 To: Marcus Boerger Cc: Sebastian Kugler , Oliver =?ISO-8859-1?Q?Gr=E4tz?= , internals@lists.php.net In-Reply-To: <1845355691.20051126135605@marcus-boerger.de> References: <7.0.0.16.2.20051124161240.0573e640@zend.com> <200511251419.56809.pookey@pookey.co.uk> <57.B8.56276.65B27834@pb1.pair.com> <73998811.20051125204046@marcus-boerger.de> <438782C6.80008@gmail.com> <43878626.5060300@lerdorf.com> <512771162.20051125225926@marcus-boerger.de> <6B.D6.56276.154E7834@pb1.pair.com> <1638013035.20051126122138@marcus-boerger.de> <818043770511260446q14947ceai64c78d146e632b71@mail.gmail.com> <1845355691.20051126135605@marcus-boerger.de> Content-Type: text/plain Date: Sun, 27 Nov 2005 09:20:53 +0800 Message-ID: <1133054453.15210.23.camel@alanportable2.hklc.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps out there) From: alan@akbkhome.com (Alan Knowles) this is not entirely true: token : "[WS]+?[WS]+" == conditional if seperater 1 token : "[WS]+:[WS]+" == conditional if seperater 2 token : ":[WS]+" == case/ if ($a == 5): / else: / endif; token : ":" == namespace stuff... eg. adding whitespace around the " : " and declaring that a token, rather than creating a token for the whitespace it, should work?? Regards Alan On Sat, 2005-11-26 at 13:56 +0100, Marcus Boerger wrote: > Hello Sebastian, > > Saturday, November 26, 2005, 1:46:31 PM, you wrote: > > > On 11/26/05, Marcus Boerger wrote: > >> The only thing that matters is whether i can write a correct > >> lexer/parser for this without breaking stuff. > > > Im no parser expert at all, so just to be sure that I understand the > > problem correctly: I guess you can't distinguish at the parser/lexer > > level between cases where it's ambiguos without white spaces and where > > it isn't? > > A lexer splits on tokens while white space is optional. If present it > allows separation of tokens. Forcing this would make whitespace a token > which would be very bad. The parser then works on the tokens and doesn't > see any whitespace. > > > Alternatively, could you provide a configuration switch to turn the > > use of namespace constants in the ternary on or off? (So that people > > who don't use namespace constants but use the ternary without spaces > > wouldn't need to change all their code?) > > That is no option at all becuase it would make it impossible to write > portable php code. > > marcus >