let location_of_module_element = function
  | Element_module m -> Some m.m_loc
  | Element_module_type m -> Some m.mt_loc
  | Element_class c -> Some c.cl_loc
  | Element_class_type c -> Some c.clt_loc
  | Element_value v -> Some v.val_loc
  | Element_type t -> Some t.ty_loc
  | Element_exception e -> Some e.ex_loc
  | Element_module_comment _ -> None
  | Element_included_module _ -> None