m-schmoock / lcpp

A Lua C PreProcessor
130 stars 21 forks source link

bug in define #9

Closed andresy closed 10 years ago

andresy commented 11 years ago

hello,

i just noticed that a single line like the following:

define SOME_VARIABLE 0xFF

is properly parsed, but:

define SOME_VARIABLE (0xFF)

fails with: lcpp ERR [0000] already defined: SOME_VARIABLE

any clue about it before i try to debug it?

cheers, ronan

m-schmoock commented 11 years ago

Yes your right, that's a bug. I will fix it soon or if you like you can also have a look. I think it tries to parse the define as a functional macro which fails, because there is no macro body after the "parameter list := 0xFF)

regards, Michael

On Wed, July 3, 2013 9:48 pm, Ronan Collobert wrote:

hello,

i just noticed that a single line like the following: #define SOME_VARIABLE 0xFF is properly parsed, but: #define SOME_VARIABLE (0xFF) fails with: lcpp ERR [0000] already defined: SOME_VARIABLE

any clue about it before i try to debug it?

cheers, ronan


Reply to this email directly or view it on GitHub: https://github.com/willsteel/lcpp/issues/9

m-schmoock commented 10 years ago

there was some development...

this input:

define SOME_VARIABLE (0xFF)

SOME_VARIABLE

gives now: $> file=bla.h make file lua -e 'lcpp = require("lcpp"); local out = lcpp.compileFile("bla.h"); print(out);' (255)

I think this is correct now, is it?

regards Michael