Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38905 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87503 invoked from network); 10 Jul 2008 16:46:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jul 2008 16:46:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 193.227.246.108 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 193.227.246.108 ip246-108-v193.static.x-ip.net Received: from [193.227.246.108] ([193.227.246.108:46771] helo=lovelace.midden.org.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/70-11681-D6636784 for ; Thu, 10 Jul 2008 12:18:54 -0400 Received: from office.vbulletin.com ([217.155.246.60] helo=[10.0.0.116]) by lovelace.midden.org.uk with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KGytr-0005I7-Ug; Thu, 10 Jul 2008 17:21:46 +0100 Message-ID: <4876365E.9080609@macvicar.net> Date: Thu, 10 Jul 2008 17:18:38 +0100 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Nuno Lopes CC: Matt Wilmas , internals@lists.php.net, Dmitry Stogov References: <013a01c8aec5$b189d650$0201a8c0@pc1> <013201c8e28a$e024a000$0201a8c0@pc1> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.3 X-Spam_Report: Spam detection software, running on the system "lovelace.midden.org.uk", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: There hasn't been an official release with the NOWDOCS token though. Scott Nuno Lopes wrote: > Patch seems ok to me, although I haven't tested it. But let's see what > Dmitry thinks about it. > I'm not sure about the removal of the nowdoc tokens, though. Somebody > may me relying on them for pretty-printing.. > > Nuno > > > ----- Original Message ----- From: "Matt Wilmas" > To: > Cc: "Dmitry Stogov" ; "Nuno Lopes" > Sent: Thursday, July 10, 2008 1:45 PM > Subject: Re: [PHP-DEV] [PATCH] Some string changes/optimizations > > >> Hi all, >> >> I had been meaning to update this patch for a while (after conflicting >> updates to some files), and finally did. :-) See original message for >> more >> details... >> >> There's been one change for strings -- before, I was moving the first >> ADD_* >> op into INIT_STRING, but wasn't too satisfied with that. So I eliminated >> the INIT_STRING opcode after realizing that simply setting the string to >> NULL makes it create a new string in add_string_to_string (the first >> ADD_* >> has op1 set to IS_UNUSED; otherwise it's still IS_TMP_VAR, though it's >> not >> "used" after my changes). Is this OK? >> >> The other prior changes seem fine to me: syntax highlighting consistency, >> combining the duplicate heredoc/nowdoc stuff and removing the NOWDOC >> tokens, >> allowing static heredocs to be used in static contexts, etc.? >> >> http://realplain.com/php/string_optimizations.diff >> http://realplain.com/php/string_optimizations_5_3.diff >> >> Remember to regenerate the scanner/parser with re2c/bison and run >> zend_vm_gen.php! I also included possible NEWS updates in the 5.3 patch >> this time. :-P >> >> >> Thanks for any feedback, >> Matt >> >> >> ----- Original Message ----- >> From: "Matt Wilmas" >> Sent: Monday, May 05, 2008 >> >>> Hi all, >>> >>> This patch... Saves one opcode per interpolated string [snip, old info] >>> >>> Next, after nowdoc support was added, I noticed it was mostly duplicate >>> heredoc code in the scanner, so I combined them for the most [...] Content analysis details: (-4.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.1 AWL AWL: From: address is in the auto white-list Subject: Re: [PHP-DEV] [PATCH] Some string changes/optimizations From: scott@macvicar.net (Scott MacVicar) There hasn't been an official release with the NOWDOCS token though. Scott Nuno Lopes wrote: > Patch seems ok to me, although I haven't tested it. But let's see what > Dmitry thinks about it. > I'm not sure about the removal of the nowdoc tokens, though. Somebody > may me relying on them for pretty-printing.. > > Nuno > > > ----- Original Message ----- From: "Matt Wilmas" > To: > Cc: "Dmitry Stogov" ; "Nuno Lopes" > Sent: Thursday, July 10, 2008 1:45 PM > Subject: Re: [PHP-DEV] [PATCH] Some string changes/optimizations > > >> Hi all, >> >> I had been meaning to update this patch for a while (after conflicting >> updates to some files), and finally did. :-) See original message for >> more >> details... >> >> There's been one change for strings -- before, I was moving the first >> ADD_* >> op into INIT_STRING, but wasn't too satisfied with that. So I eliminated >> the INIT_STRING opcode after realizing that simply setting the string to >> NULL makes it create a new string in add_string_to_string (the first >> ADD_* >> has op1 set to IS_UNUSED; otherwise it's still IS_TMP_VAR, though it's >> not >> "used" after my changes). Is this OK? >> >> The other prior changes seem fine to me: syntax highlighting consistency, >> combining the duplicate heredoc/nowdoc stuff and removing the NOWDOC >> tokens, >> allowing static heredocs to be used in static contexts, etc.? >> >> http://realplain.com/php/string_optimizations.diff >> http://realplain.com/php/string_optimizations_5_3.diff >> >> Remember to regenerate the scanner/parser with re2c/bison and run >> zend_vm_gen.php! I also included possible NEWS updates in the 5.3 patch >> this time. :-P >> >> >> Thanks for any feedback, >> Matt >> >> >> ----- Original Message ----- >> From: "Matt Wilmas" >> Sent: Monday, May 05, 2008 >> >>> Hi all, >>> >>> This patch... Saves one opcode per interpolated string [snip, old info] >>> >>> Next, after nowdoc support was added, I noticed it was mostly duplicate >>> heredoc code in the scanner, so I combined them for the most part, >> removing >>> the NOWDOC tokens, etc. Is that OK? It seems like they may have just >> been >>> there for the parser... but I updated the parser so that static heredocs >>> also work like nowdocs. Also removed the ST_START_[HEREDOC|NOWDOC] >>> states >>> in the scanner, by doing their work (to catch immediate ending label) in >> the >>> initial heredoc rule. >>> >>> While removing the NOWDOC references from zend_highlight.c, I made a >> little >>> change that I think improves (err... adds) highlighting of variables in >>> double-quoted strings, and makes literal text in heredocs/backticks the >>> correct "highlight_string" color. This makes coloring consistent across >> all >>> strings. :-) Before/after example: >> http://realplain.com/php/highlight.html >>> >>> Speaking of backticks, while updating their parser grammar, they now >> behave >>> more precisely like shell_exec(), in that `cmd` (constant string) or >> `$cmd` >>> (one variable) won't use INIT_STRING and create a temporary variable... >>> >>> Oh, almost forgot a couple things -- for HEAD: [snip] moved >>> HANDLE_NEWLINES() so nowdoc text is copied first, otherwise the line >> number >>> would be off if there's an error in zend_copy_scanner_string. [snip] >>> >>> http://realplain.com/php/string_optimizations.diff >>> http://realplain.com/php/string_optimizations_5_3.diff >>> >>> >>> Thanks, >>> Matt >>> >>> P.S. (for Marcus?), the ({LABEL}|([']{LABEL}['])|(["]{LABEL}["])) >>> part of >>> the heredoc rule crashed re2c (Windows) until I added the extra ( ), >>> which >>> shouldn't be needed AFAIK and was fine with just 2 alternate matches... > >