Fix for Issue #39: allow anonymous struct fields not only of union/struct types. Although the C1X standard doesn't really allow it, some compilers (MSVC) do,
and Windows headers have typedefs there. Since pycparser shouldn't semantically follow typedefs, and it isn't about rejecting all invalid code, there's
no harm in allowing this
diff --git a/z_test.py b/z_test.py
index 32d42e1..3b6ad6b 100644
--- a/z_test.py
+++ b/z_test.py
@@ -76,7 +76,24 @@
 

 if __name__ == "__main__":    

     source_code = """

-typedef struct tagHash Hash;            """

+    typedef int POINT;

+    typedef int HWND;

+    typedef int UINT;

+    typedef int ULONG_PTR;

+    typedef int DWORD;

+typedef struct tagMOUSEHOOKSTRUCT {

+    POINT   pt;

+    HWND    hwnd;

+    UINT    wHitTestCode;

+    ULONG_PTR dwExtraInfo;

+} MOUSEHOOKSTRUCT,  *LPMOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT;

+

+typedef struct tagMOUSEHOOKSTRUCTEX

+{

+    MOUSEHOOKSTRUCT;

+    DWORD   mouseData;

+} MOUSEHOOKSTRUCTEX, *LPMOUSEHOOKSTRUCTEX, *PMOUSEHOOKSTRUCTEX;

+    """

 

     #--------------- Lexing 

     #~ def errfoo(msg, a, b):
@@ -96,7 +113,7 @@
     parser = CParser()

     ast = parser.parse(source_code, filename='zz')

     ast.show(showcoord=False)

-    nv=NodeVisitor()

-    nv.visit(ast)

+    #~ nv=NodeVisitor()

+    #~ nv.visit(ast)