[prev in list] [next in list] [prev in thread] [next in thread]
List: groovy-dev
Subject: Re: [groovy-dev] Is it a BUG?
From: Danno Ferrin <shemnon () yahoo ! com>
Date: 2004-06-11 2:35:51
Message-ID: cab5q5$drp$1 () sea ! gmane ! org
[Download RAW message or body]
Yes you can, but what is in the string is not a valid groovy snippet
while the entire snippit outside of the string as a while is valid
groovy (and java if properly placed in a class and method). The error
comes from evaluating a program that looks like
a='
Which in and of itself is grammatically invalid for Groovy.
And since the original snippet produces no output anyway and nothing is
reported in the exception (not even a 'e.printStackTrace()') whether or
not the string holding the script is valid or not no output would result
anyway.
--Danno
(I'm not sure, is the horse dead yet? I thought I saw a twitch...)
Mik Lernout wrote:
> Hmm, just of the top of my head, but shouldn't you be able to put into a
> String whatever you want?
>
> My 2 cents and stuff,
>
> Mik
>
> Danno Ferrin wrote:
>
>> I don't think that the string is a valid groovy script, the single
>> quote is unterminated so the lexer should fail. if the string were
>> "a=\'\'" or "a=1" it should work fine.
>>
>> --Danno
>>
>> Chris Poirier wrote:
>>
>>> Hi boskey,
>>>
>>>
>>>> String str = "a=\'";
>>>> Object o = gs.evaluate(str);
>>>>
>>>> }
>>>> catch(Exception e ){
>>>> }
>>>> ........
>>>> ....
>>>>
>>>> when the code runs into "Object o = gs.evaluate..." ,then the
>>>> program have no response.
>>>
>>>
>>>
>>>
>>> It's likely a bug in the lexer (there is a similar one with the double
>>> quote). I'm working on the lexer code, and I'll have a look when I get
>>> a chance.
>>>
>>> Later,
>>> Chris.
>>>
>>>
>>
>
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic