Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
1.0-beta-7, 1.0-beta-8
-
None
-
None
Description
Here-docs seem to treat the entire text from <<< to the end of the line as the token. It can be very difficult to find this bug with the lack of a line number on the error message. I.e.
Code like this:
print(<<<EOS
hello
EOS);
which contains a hidden space after the <<<EOS, yields this error message
Caught: C:\projects\groovy-1.0-beta-8\test2.groovy: -1: expected ")"; found '' at -1:-1
The lack of any line number makes this very difficult to track down in a large file.
Spaces after the opening here-doc token seem to be legal in my version of perl (5.8.x) – though not spaces before the closing token, which would be a nice addition that should be in perl 6.
Also would be nice if the docs noted the rules about here-docs. I'd be happy to fix those if someone tells me the desired functionality.