I'm writing an AST Transformation. I'm using the ReaderSource object
available through the SourceUnit to get the source code that the code
was compiled with.
Is there any sort of convenience method to strip out comments from the
results of ReaderSource.getLine() ?
Here is my scenario:
I want all the code within a closure in String form. So { println
"Hello" } becomes just "println \"Hello\""
I have been calling readLine and then ripping the first and last curly
brace out of the string result. However, I tried it on source like
this and it broke:
{ println "Hello" } // a comment
and
{ println "Hello" } /* a comment */
Any advice?
--
Hamlet D'Arcy
hamletdrc@...
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email--
Hamlet D'Arcy