Nowdocs revised
| From: | Gwynne Raskind | Date: | Mon, 23 Jul 2007 13:21:40 +0000 |
| Subject: | Nowdocs revised | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-31183@lists.php.net to get a copy of this message | ||
I've taken my original nowdocs patch and revamped it to be much more efficient and functional. This version:
- Parses nowdocs as constant strings rather than ADD_STRING opcodes.
- Allows the flex scanner do less work.
- Enables nowdocs to be used in static_scalar contexts, such as class constants and static variable initializers.
- Includes more tests than before.
- Is fully compatible with the most recent CVS checkouts for HEAD and PHP_5_2, and also merges cleanly into a 5.2.3 source tree.
- Breaks zero regression tests out of all 3000 or so.
The patch also cleans up the zend_language_scanner.l code a little bit, cosmetically speaking, and the PHP_5_2 patch updates the scanner by factoring out single-quoted string scanning, as HEAD already did. The patch is available for download at <http://phpdoc.gwynne.dyndns.org/nowdocs.zip>, and browsable at <http://phpdoc.gwynne.dyndns.org/nowdocs/>.
-- Gwynne, Daughter of the Code
"This whole world is an asylum for the incurable."