Source file compat.ml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# 1 "src/model/compat.cppo.ml"
type visibility =
| Exported
| Hidden
type module_type =
Mty_ident of Path.t
| Mty_signature of signature
| Mty_functor of functor_parameter * module_type
| Mty_alias of Path.t
and functor_parameter =
| Unit
| Named of Ident.t option * module_type
and module_presence =
| Mp_present
| Mp_absent
and signature = signature_item list
and signature_item =
Sig_value of Ident.t * Types.value_description * visibility
| Sig_type of Ident.t * Types.type_declaration * Types.rec_status * visibility
| Sig_typext of Ident.t * Types.extension_constructor * Types.ext_status * visibility
| Sig_module of
Ident.t * module_presence * module_declaration * Types.rec_status * visibility
| Sig_modtype of Ident.t * modtype_declaration * visibility
| Sig_class of Ident.t * Types.class_declaration * Types.rec_status * visibility
| Sig_class_type of Ident.t * Types.class_type_declaration * Types.rec_status * visibility
and module_declaration =
{
md_type: module_type;
md_attributes: Parsetree.attributes;
md_loc: Location.t;
}
and modtype_declaration =
{
mtd_type: module_type option;
mtd_attributes: Parsetree.attributes;
mtd_loc: Location.t;
}
let opt conv = function | None -> None | Some x -> Some (conv x)
# 76 "src/model/compat.cppo.ml"
let rec signature : Types.signature -> signature = fun x -> List.map signature_item x
and signature_item : Types.signature_item -> signature_item = function
| Types.Sig_value (a,b,c) -> Sig_value (a,b,visibility c)
| Types.Sig_type (a,b,c,d) -> Sig_type (a,b,c, visibility d)
| Types.Sig_typext (a,b,c,d) -> Sig_typext (a,b,c,visibility d)
| Types.Sig_module (a,b,c,d,e) -> Sig_module (a, module_presence b, module_declaration c, d, visibility e)
| Types.Sig_modtype (a,b,c) -> Sig_modtype (a, modtype_declaration b, visibility c)
| Types.Sig_class (a,b,c,d) -> Sig_class (a,b,c, visibility d)
| Types.Sig_class_type (a,b,c,d) -> Sig_class_type (a,b,c, visibility d)
and visibility : Types.visibility -> visibility = function
| Types.Hidden -> Hidden
| Types.Exported -> Exported
and module_type : Types.module_type -> module_type = function
| Types.Mty_ident p -> Mty_ident p
| Types.Mty_signature s -> Mty_signature (signature s)
| Types.Mty_functor (a, b) -> Mty_functor(functor_parameter a, module_type b)
| Types.Mty_alias p -> Mty_alias p
and functor_parameter : Types.functor_parameter -> functor_parameter = function
| Types.Unit -> Unit
| Types.Named (a,b) -> Named (a, module_type b)
and module_presence : Types.module_presence -> module_presence = function
| Types.Mp_present -> Mp_present
| Types.Mp_absent -> Mp_absent
and module_declaration : Types.module_declaration -> module_declaration = fun x ->
{ md_type = module_type x.Types.md_type;
md_attributes = x.md_attributes;
md_loc = x.md_loc }
and modtype_declaration : Types.modtype_declaration -> modtype_declaration = fun x ->
{ mtd_type = opt module_type x.Types.mtd_type;
mtd_attributes = x.Types.mtd_attributes;
mtd_loc = x.Types.mtd_loc }