Anonymous structs and unions in libclang

Hi List,

I’m trying to write a header file preprocessor with dependency tracking for LuaJIT.
Unfortunately LuaJIT does not have C preprocessor, but it’s able to parse C
sturcture and function declarations (as lua strings) using FFI interface.

All i need to do is given a root' header file, track down all of it's dependencies (includes), and generate wrapper lua module with preprocessed declarations for each header file (and make sure it's not included’ twice in lua since LuaJIT prohibits multiple
declarations of the same entity the same way C compilers do).

I’m trying to traverse AST nodes that are interesting to me, printing out pretty much the
same as input, but without macros, with typedefs resolved, etc. libclang does a great job
of building include tree, checking if header is guarded, finding all interesting declarations!
But looks like it’s missing support for anonymous structs and unions. For a simple header
file like this:

struct mystruct {

union {
int a;
float c;
struct {
const char *str1;
char *str2;
} anon_struct;
int d;
char e;

I get an Unexposed type kind with the following spelling:
struct anon_struct;

Does Clang itself provides all necessary information about those constructs? Is this
information simply not exposed via libclang? Or I’m missing something?