|
[
Permalink
| « Hide
]
Jason Dillon added a comment - 17/Oct/07 11:51 AM
I'm not really sure what the proper fix for this puppy is.... but I have found that if we insert an expression into the bufferer when evaluating (after imports, before user code) that things seem to be much happier.
This may be fixed now in trunk. I was not really sure what the best solution was... and the wee hack I added might actually cause other strangeness... I'm not sure. Seems to be harmless so far. Basically, I just added a dummy true statement to the evaluated buffer after imports and before the user's code when evaluating (when parsing to detect a complete buffer this isn't used).
So, for example if you entered: groovy:000> enum E {A,B,C}
Internally, it will parse out: enum E {A,B,C}
and then since this is complete it will evaluate: true
enum E {A,B,C}
And if imports were added, then a enum, like: groovy:000> import java.*
groovy:000> enum E {A,B,C}
It will parse out: import java.*
enum E {A,B,C}
And then it will evaluate: import java.*
true
enum E {A,B,C}
|
|||||||||||||||||||||||||||||||||||||||||||||||