velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Byron Foster (JIRA)" <>
Subject [jira] Commented: (VELOCITY-623) Modify escape behavior in strict mode
Date Fri, 10 Oct 2008 19:42:44 GMT


Byron Foster commented on VELOCITY-623:

My thoughts are that no, there is no particular reason.  Macro's are a problem because the
parser handles the escaping such that no node is even created for something like "\#abc()
which makes it impossible to do the post parse processing that can be done with references.
 If it wasn't for this I would have also "fixed" the macro escaping for strict mode :)  To
change the behavior of macro escaping the parser will have to be changed, However, not a major

In allot of ways strict mode along with sane escaping rules really simplifies things because
then you either have a valid reference with no escape processing necessary, or a text node
(maybe actually, or essentially).  As it stands the ASTReference Node has allot of member
fields dedicated to various escape gymnastics.  I'm not even sure what all the bang escaping
is for.

I think were you are going with this is that it would be nice to have a property that modifies
the behavior of escaping, and perhaps tests how it will work in the future, in a python future
sort of way.  If this is the case it would be good to get it all right.  Anyway, I'll look
into it some more.

> Modify escape behavior in strict mode
> -------------------------------------
>                 Key: VELOCITY-623
>                 URL:
>             Project: Velocity
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>         Attachments: StrictEscapeWithProperty.patch
> provides another property 'runtime.references.strict.escape' that when true modifies
the behavior of escaping a reference when in strict mode, see discussion VELOCITY-618.  The
behavior is a as follows:
> $abc = <exception>    -  If $abc is not defined
> \$abc = $abc 
> \\$abc = <exception>  - If $abc is  not defined
> \\\$abc = \$abc
> The backslash in front of a reference always prevents that reference from being evaluated,
and the backslash is removed. This is true wether a reference is in the context or not.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message