lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Feb 28, 2011 at 5:13 PM, Mike Pall <mikelu-1102@mike.de> wrote:
> Andrew Yourtchenko wrote:
>> And I think the best approach is actually to implement the
>> preprocessor itself.
>
> Umm ... an integrated pre-processor is definitely on my TODO list
> for the FFI. I just don't know when I'll get around to it.
>

awesome! :-)

Couple of evenings ago I got the #ifdef/#ifndef/#else to work (and the
beginnings of the parameter-less as well as parametrized #defines).
All of the code quite a bit ugly/incomplete at this point, but so far
I am able to deal with the pearls like this:

/\
*
*/ # /*
*/ defi\
ne FO\
O 10\
20 /*
*/ 23

The parametrized macros calls that stretch multiple lines not handled
yet - but I will deal with that when I get the rest of the stuff done
- like proper parsing of the expressions within the #if.

Here's a good set of unit-tests IMHO:
http://chaos-pp.cvs.sourceforge.net/viewvc/chaos-pp/order-pp/example/fibonacci.c?revision=1.8&view=markup

>> Having a Lua-aware CPP would allow also to pull in the #define-d
>> primitives - which would be a plus.
>
> That's part of the plan, of course.

Neat. Thanks!

cheers,
andrew

>
> --Mike
>
>