Spaces in modifiers (revisted)

From: Date: Wed, 17 Dec 2003 09:25:44 +0000
Subject: Spaces in modifiers (revisted)
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1999@lists.php.net to get a copy of this message
Hi all. Before I take my extended holiday, I thought I would make an attempt to revist something that is dear to me. I am of course refering to my suggestion to allow whitespace in the modifier syntax as outlined in this post http://lists.php.net/article.php?group=php.smarty.dev&article=1332 and which was previously dismissed after very little (but light-hearted) discussion. I have re-tested right-up to the current cvs and to-date have not found a single case which breaks the parser (my first post on this was May 2nd). The key reason I see for this not playing a parsing factor is that the | and : characters act as guards which effectively prevent the parser from confusing the modifier syntax with other constructs, including {if}. Why, even things like the following work, though parens should obviously be added (they too work) for clarity. Note the leading negation and the use of the || conditional operator: {if ! "foo" |in_array: $BLOCK->blocks || "bar" |in_array: $BLOCK->blocks} Considering the many places that whitespace is currently allowed, it seems natural to extend it to modifiers as well. It makes reading the code not only easier, but can also help reduce syntax errors that are based purely on whitespace errors. I admit that I do not use every single feature of Smarty and I'm certainly not trying to start a flamefest so if anyone sees the merit of this, please test it for yourself and report your experience. Even if you are of the camp that sees this as unneccessary, I would appreciate hearing why (or where) this throws a, uhm, monkey-wrench into the works :) Thanks for the reading--cheers and a happy holiday season to all! xo boots __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/

« previous php.smarty.dev (#1999) next »