My project has been using the GroovyShell#evaluate method since the 0.3
release of Groovy. The parameter of the method is a
java.lang.String which
has been deployed into the field and cannot be updated/recalled.
We want to update to Groovy 1.5, but the deployed scripts contain usages of
the | delimiter for closure arguments instead of the -> delimiter.
Obviously, you cannot pass a script containing the | delimiter into the 1.5
GroovyShell#evaluate without an exception being thrown.
There are other syntax differences between 0.3 and 1.5, but we have worked
around them by using metaprogramming to make the GroovyShell#evaluate
backwards compatible with 0.3. We do have the original source of the
deployed Groovy scripts, so we know which pieces of the syntax we need to
support. We do not need to provide full compatibility between 0.3 and 1.5.
We have a working solution for everything except using | instead of -> to
separate closure parameters from the body.
Does anyone have any clever ideas on how to support this?
Our best current thoughts are to define a grammar for the scripts and
actually parse the things. Doing regex style replacements don't seem a good
option because of the size of the job and testing that would be required.
Thanks in advance for any ideas,
-----
--
Hamlet D'Arcy
--
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email