forked from camlspotter/ocamloscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxenv.ml
42 lines (39 loc) · 1.11 KB
/
xenv.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
open Spotlib.Spot
open Env
module Summary = struct
let format ppf env =
let open Format in
let rec f = function
| Env_empty -> ()
| Env_value (s, id, _) ->
fprintf ppf "val %s@," (Ident.name id);
f s
| Env_type (s, id, _) ->
fprintf ppf "type %s@," (Ident.name id);
f s
| Env_extension (s, id, _) ->
fprintf ppf "extension %s@," (Ident.name id);
f s
| Env_module (s, id, _) ->
fprintf ppf "module %s@," (Ident.name id);
f s
| Env_modtype (s, id, _) ->
fprintf ppf "module type %s@," (Ident.name id);
f s
| Env_class (s, id, _) ->
fprintf ppf "class %s@," (Ident.name id);
f s
| Env_cltype (s, id, _) ->
fprintf ppf "class type %s@," (Ident.name id);
f s
| Env_open (s, p) ->
fprintf ppf "open %s@," (Path.name p);
f s
| Env_functor_arg (s, id) ->
fprintf ppf "functor arg %s@," (Ident.name id);
f s
in
fprintf ppf "@[<v>";
f & summary env;
fprintf ppf "@]"
end