[
https://issues.apache.org/jira/browse/VELOCITY-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16621774#comment-16621774
]
Claude Brisson commented on VELOCITY-542:
-----------------------------------------
While I do understand your concerns, I shall state that:
* Allowing the hyphen in the first place for 1.x was obviously a mistake that
we had to fix, this is not a minor use case. I've never heard of any language
where adding a space around a minus sign is needed to disambiguate it from an
hyphen, and I've seen several times template writers (if not me) stumble on it.
* The change is [properly
documented|http://velocity.apache.org/engine/2.0/upgrading.html#vtl-changes].
But it doesn't stop us from allowing a backward compatibility option, which
would please everyone. Since the parser behavior is defined at compile time, it
means shipping Velocity with two distinct parsers, the actual one and the
most-possible-backward-compatible-one.
A lot has been done to maximize backward compatibility on several points but
this one has been left out, mainly because I was reluctant to include two
parsers. Why not, after all.
[[email protected]], you also state "nearly every customer had
templates break as a result of this change (and others)". What were those other
changes? We may want to also consider them in the process.
And as usual, if anyone want to contribute code, you're most welcome. We all
have a day job.
> minus sign in #set requires spaces to surround it
> -------------------------------------------------
>
> Key: VELOCITY-542
> URL: https://issues.apache.org/jira/browse/VELOCITY-542
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.5
> Reporter: Will Glass-Husain
> Assignee: Claude Brisson
> Priority: Minor
> Fix For: 2.0
>
>
> The following example:
> #set($thisCampNumber = 10)
> #set($nextCampNumber = $thisCampNumber+1)
> #set($previousCampNumber = $thisCampNumber-1)
> #set($previousCampNumberB = $thisCampNumber - 1)
> 1: $thisCampNumber<br>
> 2: $nextCampNumber<br>
> 3: $previousCampNumber<br>
> 4: $previousCampNumberB<br>
> produces this result
> 1: 10
> 2: 11
> 3: $previousCampNumber
> 4: 9
> Note that using a minus sign in a #set statement does not work if there are
> no spaces around it. (however, the same is not true for +).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]