let declare_struct ~env ~is_union name =
try
match List.assoc name env.struct_name_table with
StructName id ->
let desc = get_struct_desc ~env id in
if desc.str_union_p <> is_union then
raise (Type_Error_local "name of union/struct crash with other struct/union name")
else id
| EnumName ->
raise (Type_Error_local "name of union/struct crash with other enum name")
with
Not_found ->
let id = make_incomplete_struct_definition ~env ~is_union in
env.struct_name_table <- (name, StructName id) :: env.struct_name_table;
id