lcpp
lcpp copied to clipboard
A Lua C PreProcessor
Judging by the lack of license I'm guessing MIT is gonna be your choice but it is still better for clarity, incidentally are you going for GCC compatibility at all?...
Michael, as we discussed - here is a bunch of commits, mostly sequenced in order "testcase then fix". One of the fixes (multiline comment within the macro definition) causes the...
processing this input: ``` return 0xff; ``` results in the following output: ``` return255; ``` Conversion to decimal is probably OK (though nominally preprocessor should not do it), but eating...
Testcase: ``` h print(__FILE__) ``` The file name gets substituted without the double quotes.
Processing this chunk with lcpp: ``` h #define foo \ /* Comment here \ which spans lines */ \ this should never appear in the output \ but it does...
Processing this file: ``` h #define MACRO(a) a MACRO(((int)0)) MACRO((int)1) MACRO(2) ``` results in output: ``` ((int)0) (int) 2 ``` i.e. if a macro argument is preceded by a parenthesized...
Processing the below .h file (synthesized from real-world sequence of includes from the fd.io) with lcpp results in an infinite loop. Using anything other than a single underscore for the...
Compiling this code, reduced from a real world include file: ``` h #define _(t,n) typedef union n##t _ (u8, 16); #undef _ ``` Results in output "typedef uniou16 16u8", the...
If I try to load some libs, I've got an error: ``` /home/v/.luarocks/share/lua/5.2/lcpp.lua:1952: unknown type namespace on line _linenum_ ``` What about it? P.S.: I load it with ffi.cdef().
refs willsteel/lcpp #12 add _Pragma as default predefined function refs willsteel/lcpp #13 fix bug that #x (stringify operator) 's apply order is wrong as argument in #12, we add _Pragma...