Re: [SMARTY-DEV] Handling TRUE,FALSE,NULL,ON,OFF, etc
| From: | messju mohr | Date: | Fri, 09 Apr 2004 18:47:45 +0000 |
| Subject: | Re: [SMARTY-DEV] Handling TRUE,FALSE,NULL,ON,OFF, etc | ||
| References: | 1 2 3 4 5 6 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2272@lists.php.net to get a copy of this message | ||
On Fri, Apr 09, 2004 at 11:18:17AM -0700, Andrei Zmievski wrote:
> On Thu, 08 Apr 2004, Mark Rogers wrote:
> > My point (which you snipped) is that where we don't accept |DEFAULT we *do*
> > accept TRUE/FALSE etc, then interpret them non-intuitively.
>
> The fact that we accept invalid tokens is a bug, not a feature.
>
> > To accept (without error) TRUE and interpret it differently from true is
> > counter-intuitive.
>
> Of course.
>
> > I am sure that you would not advocate dropping support for TRUE from
> > PHP and treating it as string "TRUE".
>
> Of course not.
>
> > Personally, while I think case sensitivity is a Good Thing in a programming
> > language (eg PHP) I'm not sure it is relevant in a templating language
> > (Smarty) - but would not argue against it. But surely we should either error
> > on TRUE/FALSE/null if they are wrong, or interpret them intuitively
> > otherwise. I cannot see an argument for interpreting them as they are
> > currently interpretted.
>
> It should be fixed to not accept invalid (differently cased tokens).
hmm. to me this was always intuitive:
- "true", "false", "on", "off" and "null" are
case-sensitive and special.
- all other \w+ are treated as strings.
please don't break stuff like {assign var=foo value="v"} or
{$var|escape:javascript} by treating invalid (=unknown) tokens as
syntax-errors.
> - Andrei