[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    [SMARTY-DEV] Spaces in modifiers (revisted)
From:       boots <jayboots () yahoo ! com>
Date:       2003-12-17 9:25:44
[Download RAW message or body]

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/

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic