Windows and resulting char *trace

Mildred Ki'Lya ml.mildred593 at gmail.com
Tue Aug 25 08:56:03 UTC 2009


On 08/25/2009 05:06 AM, sonntag benoit wrote:
> Jeremy Cowgar <jeremy at cowgar.com> a écrit :
>
>> On windows, C code get's added with an invalid escape sequence:
>>
>> char *trace[30]={
>>   "C:\Development\Projects\Lisaac\compiler/make.lip
>> (C:\Development\Projects\Lisaac\compiler/make.lip)",
>>
>> I believe that the \ should either be escaped, or better yet, converted
>> to / as MinGW will handle / paths just fine on Windows.
>>
>
> I will regulate this little problem, while waiting, compiles with -boost
> or -no_debug.
> It is necessary that i install an Winfuck! :-)

I think I fixed that problem in my mildred-projects branch.

Currently the compiler doesn't interpret escape sequences while parsing,
and put them as they are in the .c file. So, to write a string constant,
the compiler basically do:

c_file.add_last '"';
c_file.append string_constant;
c_file.add_last '"';

If the escape sequences are not properly formatted in the string, this
can result in an error in the c file.

What I did was to interpret the escape sequences in the parser, and
whenever a string constant was written in tha c file, the escape
sequences were recreated, according to the C language. This also have
the advantage to make it possible in the future to handle other
languages beside C that don't have the same escape sequences.

Relevant patches:

http://git.debian.org/?p=lisaac/compiler.git;a=commitdiff;h=9d9ac134a41d8813bfb1dac4100a41387a24db31;hp=2b1e7188ac41ff55f761294681040216384a50d6
http://git.debian.org/?p=lisaac/compiler.git;a=commitdiff;h=64b7becd691566e501e8772a0075b68faae40f6c;hp=3d556fbc0fa2fe474b2ae5fefbc66ac1332ff876

Mildred

-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <mildred at jabber.fr>
│ Website: <http://ki.lya.online.fr>           GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/lisaac-devel/attachments/20090825/ae1a20a8/attachment.pgp>


More information about the Lisaac-devel mailing list