summaryrefslogtreecommitdiff
path: root/testsuite/tests/tool-ocamldoc/Inline_records_bis.ml
blob: 970912b3f8c40714c82e81ff3dab47cc52d60392 (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
(* TEST
 ocamldoc with latex;
*)

(**
  This test focuses on the printing of documentation for inline record
  within the latex generator.
*)


(** A nice exception *)
exception Simple

(** A less simple exception *)
exception Less of int

(** An open sum type *)
type ext = ..

(** A simple record type for reference *)
type r = { lbl: int (** Field documentation for non-inline, [lbl : int] *);
          more:int list (** More documentation for r, [more : int list] *) }


(** A sum type with one inline record *)
type t = A of {lbl: int (** [A] field documentation *)
              ; more:int list (** More [A] field documentation *) }
(** Constructor documentation *)

(** A sum type with two inline records *)
type s =
  | B of { a_label_for_B : int (** [B] field documentation *);
               more_label_for_B:int list (** More [B] field documentation *) }
  (** Constructor B documentation *)
  | C of { c_has_label_too: float (** [C] field documentation*);
           more_than_one: unit (** ... documentations *)  }
  (** Constructor C documentation *)

(** A gadt constructor *)
type any = D: { any:'a (** [A] field [any:'a] for [D] in [any]. *) } -> any
(** Constructor D documentation *)

exception Error of {name:string (** Error field documentation [name:string] *) }

type ext +=
  | E of { yet_another_field: unit (** Field documentation for [E] in ext *) }
  (** Constructor E documentation *)
  | F of { even_more: int -> int (** Some field documentations for [F] *) }
  (** Constructor F documentation *)
  | G of { last: int -> int (** The last and least field documentation *) }
  (** Constructor G documentation *)
(** Two new constructors for ext *)