lua-users home
lua-l archive

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


The possibility to wrap unions with tolua is a great advantage, thanks.
However, I recognised the following problem.

The following works find when only using structs:
struct a {
...
};

struct A {
 struct a x;
 ...
};

It does not work for unions (parser error).
/* Kind A - not working */
struct a {
 ...
};

union A {
 struct a x;
 ...
};

fails.

I have to put struct a first into a typedef which can then be successfully used inside the
union, e.g.
...
/* Kind B - works */
typedef struct a a;
union A {
 a x;
 ...
};

The need for the typedef is ugly, because it prohibits a very common practice in C.

Is it a big issue to change the parser such that it accepts kind A definitions ?

Thanks
Herbert