Sync to Wine-0.9.58
[reactos.git] / reactos / tools / widl / parser.y
index 499ae15..3a89723 100644 (file)
@@ -320,6 +320,7 @@ imp_statements:                                     {}
        | imp_statements moduledef              { if (!parse_only) add_typelib_entry($2); }
        | imp_statements statement              {}
        | imp_statements importlib              {}
+       | imp_statements librarydef             {}
        ;
 
 int_statements:                                        { $$ = NULL; }
@@ -363,12 +364,12 @@ importlib: tIMPORTLIB '(' aSTRING ')'             { if(!parse_only) add_importlib($3); }
 
 libraryhdr: tLIBRARY aIDENTIFIER               { $$ = $2; }
        ;
-library_start: attributes libraryhdr '{'       { start_typelib($2, $1);
+library_start: attributes libraryhdr '{'       { if (!parse_only) start_typelib($2, $1);
                                                  if (!parse_only && do_header) write_library($2, $1);
                                                  if (!parse_only && do_idfile) write_libid($2, $1);
                                                }
        ;
-librarydef: library_start imp_statements '}'   { end_typelib(); }
+librarydef: library_start imp_statements '}'   { if (!parse_only) end_typelib(); }
        ;
 
 m_args:                                                { $$ = NULL; }
@@ -1855,7 +1856,6 @@ static int get_struct_type(var_list_t *fields)
     case RPC_FC_FLOAT:
     case RPC_FC_DOUBLE:
     case RPC_FC_STRUCT:
-    case RPC_FC_ENUM16:
     case RPC_FC_ENUM32:
       break;
 
@@ -1906,6 +1906,7 @@ static int get_struct_type(var_list_t *fields)
     case RPC_FC_ENCAPSULATED_UNION:
     case RPC_FC_NON_ENCAPSULATED_UNION:
     case RPC_FC_BOGUS_STRUCT:
+    case RPC_FC_ENUM16:
       return RPC_FC_BOGUS_STRUCT;
     }
   }