2002-03-27 08:20:32 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* OCamldoc *)
|
|
|
|
(* *)
|
|
|
|
(* Maxence Guesdon, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 2001 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
2003-11-24 02:44:07 -08:00
|
|
|
(* $Id$ *)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
(** Representation and manipulation of a type, but not class nor module type.*)
|
|
|
|
|
|
|
|
module Name = Odoc_name
|
|
|
|
|
|
|
|
(** Description of a variant type constructor. *)
|
|
|
|
type variant_constructor = {
|
|
|
|
vc_name : string ;
|
|
|
|
vc_args : Types.type_expr list ; (** arguments of the constructor *)
|
|
|
|
mutable vc_text : Odoc_types.text option ; (** optional user description *)
|
|
|
|
}
|
|
|
|
|
|
|
|
(** Description of a record type field. *)
|
|
|
|
type record_field = {
|
|
|
|
rf_name : string ;
|
|
|
|
rf_mutable : bool ; (** true if mutable *)
|
|
|
|
rf_type : Types.type_expr ;
|
|
|
|
mutable rf_text : Odoc_types.text option ; (** optional user description *)
|
|
|
|
}
|
|
|
|
|
|
|
|
(** The various kinds of type. *)
|
|
|
|
type type_kind =
|
|
|
|
Type_abstract
|
2007-10-09 03:29:37 -07:00
|
|
|
| Type_variant of variant_constructor list
|
|
|
|
(** constructors *)
|
|
|
|
| Type_record of record_field list
|
|
|
|
(** fields *)
|
2002-03-27 08:20:32 -08:00
|
|
|
|
|
|
|
(** Representation of a type. *)
|
|
|
|
type t_type = {
|
|
|
|
ty_name : Name.t ;
|
|
|
|
mutable ty_info : Odoc_types.info option ; (** optional user information *)
|
2003-09-05 08:40:12 -07:00
|
|
|
ty_parameters : (Types.type_expr * bool * bool) list ;
|
|
|
|
(** type parameters: (type, covariant, contravariant) *)
|
2002-03-27 08:20:32 -08:00
|
|
|
ty_kind : type_kind ;
|
2007-10-09 03:29:37 -07:00
|
|
|
ty_private : Asttypes.private_flag;
|
2002-03-27 08:20:32 -08:00
|
|
|
ty_manifest : Types.type_expr option; (** type manifest *)
|
|
|
|
mutable ty_loc : Odoc_types.location ;
|
2003-06-13 04:40:31 -07:00
|
|
|
mutable ty_code : string option;
|
2002-03-27 08:20:32 -08:00
|
|
|
}
|
|
|
|
|