ECJ-INTEREST-L Archives

March 2011

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Thu, 3 Mar 2011 10:59:46 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (42 lines)
Ah, I think you're right, non \u escapes would signal a failure.   
Thanks Ben.

Sean

On Mar 2, 2011, at 4:50 PM, Ben Stabile wrote:

> Encoding/decoding of strings was not working correctly with escape  
> characters for me. I had to change the decoding switch case somewhat  
> because it was falling into the "unicode sequence" trap for no  
> apparent reason.
>
> The following change was necessary to make this work (but see the  
> warning below before making this change without checking your own  
> sources):
>
> [Code.java, line 479]
>
>                 else if (c=='\\')  // escape
>                     {
>                     x++;
>                     if ( x >= len )
>                         { d.type = DecodeReturn.T_ERROR; d.s =  
> "Unterminated String"; return; }
>                     if (dat.charAt(x)!='u' && inUnicode)
>                         { d.type = DecodeReturn.T_ERROR; d.s =  
> "Escape character in Unicode sequence"; return; }
>                     switch (dat.charAt(x))
> ...
>
> CAVEAT EMPTOR: I am working with significantly altered sources at  
> the moment, so this may not show up for others the way it has for  
> me. I am referencing the original source code linenumber above. If  
> you don't use the "Code" class for this kind of thing, you might  
> want to just ignore this. ;-)
>
> Regards,
> Ben S.
>
>
>

ATOM RSS1 RSS2