Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.4
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Environment:
-
Number of attachments :
Description
rkleeb@sifsstud4:/tmp$ cat bla.groovy
def Target = "releases$"
rkleeb@sifsstud4:/tmp$ groovy bla.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, /tmp/bla.groovy: 0: illegal string body character after dollar sign;
solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 0, column 0.
1 error
the error msg that tells you to escape the $ sign makes perfect sense, but the line / col info is always 0 / 0
Hi,
Found this issue to be there on all 1.5.8, 1.6RC1, and 1.7beta1 branches.
I am attaching a zip with fix patches for all these 3 affected versions.
The change has been made to file org\codehaus\groovy\antlr\groovy.g, which in the reported case was not retrieving the line/column number from the ANTLR exception.
After the fix, compiling
def target="Roshan$"correctly shows the line/column information in the exception as
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, C:\Try.groovy: 1: illegal string body character after dollar sign;
solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 1, column 20.
rgds,
Roshan
def target="Roshan$"