I'm trying to set a negative literal in my NVelocity template and it doesn't parse. Is there a trick to making this work?
Positive numbers work:
#set($age = 27)
Negative numbers do not work:
#set($age = -27)
#set($age = 27*-1)
Lexical error: NVelocity.Runtime.Parser.TokenMgrError: Lexical error at line 62, column 15. Encountered: "-"
I'm using Castle.NVelocity (dll-AssemblyVersion 1.1.1.0, FileVersion=1.1.1.60), not the older Apache release
Could you please provide a failing unit test because negative literals work for me. I used the HEAD of our NVelocity source repository, however I am not aware of any changes in that area since 1.1.1 was released. If my unit test fails for you with that build, I can look into when this was fixed if you like.