summaryrefslogtreecommitdiff
path: root/ocamldoc/odoc_value.mli
blob: c693c3cb4704d6a4c0018a2640cc30ae0974fac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*             Sebastien Hinderer, projet Cambium, INRIA Paris            *)
(*                                                                        *)
(*   Copyright 2022 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(** Representation and manipulation of values, class attributes and class methods. *)

module Name = Odoc_name

(** Types *)

type t_value = {
  val_name : Name.t;
  mutable val_info : Odoc_types.info option;
  val_type : Types.type_expr;
  val_recursive : bool;
  mutable val_parameters : Odoc_parameter.parameter list;
  mutable val_code : string option;
  mutable val_loc : Odoc_types.location;
}
(** Representation of a value. *)

type t_attribute = {
  att_value : t_value;
  att_mutable : bool;
  att_virtual : bool;
}
(** Representation of a class attribute. *)

type t_method = {
  met_value : t_value;
  met_private : bool;
  met_virtual : bool;
}
(** Representation of a class method. *)

(** Functions *)

val value_parameter_text_by_name : t_value -> string -> Odoc_types.text option
(** Returns the text associated to the given parameter name
   in the given value, or None. *)

val update_value_parameters_text : t_value -> unit
(** Update the parameters text of a t_value, according to the val_info field. *)

val dummy_parameter_list : Types.type_expr -> Odoc_parameter.param_info list
(** Create a list of parameters with dummy names "??" from a type list.
   Used when we want to merge the parameters of a value, from the .ml
   and the .mli file. In the .mli file we don't have parameter names
   so there is nothing to merge. With this dummy list we can merge the
   parameter names from the .ml and the type from the .mli file. *)

val is_function : t_value -> bool
(** Return true if the value is a function, i.e. has a functional type.*)