Things like this, while valid Groovy, don't eval in groovysh:
a = [
Pukes up something like:
groovy:000> a = [
ERROR org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, groovysh_parse: 4: unexpected token: 3 @ line 4, column 1.
Though this works:
a = [
well, you could try to not to send incomplete scripts to the compiler. For example if there is a open [(
)] is given. Also a line is incomplete if it ends with one of ,.-+/*%&|?<>=: and not to forget open strings. Writing something that recognizes this should not be too difficult.
This is parser voodoo to me... I wish I could fix this, but the truth is that the parser doesn't like line by line compilation similar to how python works.
Jason, in case you've got some spare cycles, you can have a look at it, otherwise I'm scheduling it for 1.7 for the moment.