[ 
https://issues.apache.org/jira/browse/VELOCITY-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark Newton updated VELOCITY-901:
---------------------------------
    Description: 
Upon upgrading to Velocity 2.0 from a very old version (1.4) hyphens in 
identifiers throw a ParseException.

To verify what was happening, I did a clean install of velocity 2.0 to test 
your example code.  After running the unmodified "example2.vm" successfully I 
added an identifier with a hyphen and the parse error occurred.

Apologies if I am missing something (e.g. spec change on identifiers).  If this 
is an issue that will take a while to fix, please let me know so that I can 
change out the hyphens to underbars in id's in my template sets.

Attached are:   1) code snippet 2) parse exception msg 3) cl used to invoke 
velocity 2.0 upon example2.vm

Best Regards

-----------------------

## code snippet

#set($test-var-w-hyphen = "test")

test-var-w-hyphen : $test-var-w-hyphen

------------------------------

[main] ERROR org.apache.velocity.parser - example2.vm: Encountered "-" at line 
20, column 11.
Was expecting one of:
 "[" ...
 <WHITESPACE> ...
 <NEWLINE> ...
 "=" ...

----------------------------

## Commandline

#/bin/bash
java -cp 
.:/home/test-a/.ant/lib/commons-lang3-3.8.jar:/home/test-a/.ant/lib/slf4j-api-1.7.25.jar:/home/test-a/.ant/lib/velocity-engine-core-2.0.jar:/home/test-a/.ant/lib/velocity-engine-scripting-2.0.jar:/home/test-a/.ant/lib/slf4j-simple-1.7.25.jar
 org.apache.velocity.example.Example2

 

 

  was:
Upon upgrading to Velocity 2.0 from a very old version (1.4) hyphens in 
identifiers throw a ParseException.

To verify what was happening, I did a clean install of velocity 2.0 to test 
your example code.  After running the unmodified "example2.vm" successfully I 
added an identifier with a hyphen and the parse error occurred.

Apologies if I am missing something (e.g. spec change on identifiers).  If this 
is an issue that will take a while to fix, please let me know so that I can 
change out the hyphens to underbars in id's in my template sets.

Attached are:  1)  code snippet 2) parse exception msg 3) cl used to invoke 
velocity 2.0 upon example2.vm

Best Regards

-----------------------

 

 

 

 


> hyphen in identifiers cause parse error
> ---------------------------------------
>
>                 Key: VELOCITY-901
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-901
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.0
>            Reporter: Mark Newton
>            Priority: Major
>         Attachments: err, example2.vm.snip, run.sh
>
>
> Upon upgrading to Velocity 2.0 from a very old version (1.4) hyphens in 
> identifiers throw a ParseException.
> To verify what was happening, I did a clean install of velocity 2.0 to test 
> your example code.  After running the unmodified "example2.vm" successfully I 
> added an identifier with a hyphen and the parse error occurred.
> Apologies if I am missing something (e.g. spec change on identifiers).  If 
> this is an issue that will take a while to fix, please let me know so that I 
> can change out the hyphens to underbars in id's in my template sets.
> Attached are:   1) code snippet 2) parse exception msg 3) cl used to invoke 
> velocity 2.0 upon example2.vm
> Best Regards
> -----------------------
> ## code snippet
> #set($test-var-w-hyphen = "test")
> test-var-w-hyphen : $test-var-w-hyphen
> ------------------------------
> [main] ERROR org.apache.velocity.parser - example2.vm: Encountered "-" at 
> line 20, column 11.
> Was expecting one of:
>  "[" ...
>  <WHITESPACE> ...
>  <NEWLINE> ...
>  "=" ...
> ----------------------------
> ## Commandline
> #/bin/bash
> java -cp 
> .:/home/test-a/.ant/lib/commons-lang3-3.8.jar:/home/test-a/.ant/lib/slf4j-api-1.7.25.jar:/home/test-a/.ant/lib/velocity-engine-core-2.0.jar:/home/test-a/.ant/lib/velocity-engine-scripting-2.0.jar:/home/test-a/.ant/lib/slf4j-simple-1.7.25.jar
>  org.apache.velocity.example.Example2
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to