2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
12 module ET = RolesTypes
13 module EU = RolesUtils
18 let out_tag i tag h map och l =
19 let aux och = List.iter (map (succ i) och) l in
20 if h then Printf.fprintf och "%s(%s%t)\n" (indent i) tag aux
21 else Printf.fprintf och "%s(%s\n%t%s)\n" (indent i) tag aux (indent i)
23 let string_map f _i och x =
24 Printf.fprintf och " %S" (f x)
26 let out_version i och v =
27 out_tag i "ver" true (string_map EU.string_of_version) och [v]
29 let out_old i och os =
30 let map (_,o) = EU.string_of_obj o in
31 out_tag i "old" true (string_map map) och os
33 let out_new i och ns =
34 let map (_,n) = EU.string_of_name n in
35 out_tag i "new" true (string_map map) och ns
37 let out_role i och (_,r) =
39 out_version i och r.ET.v;
43 out_tag i "rel" false map och [r]
45 let out_roles i och rs =
46 out_tag i "base" false out_role och rs
48 let out_status och st =
50 out_roles i och st.ET.r;
51 out_version i och st.ET.s;
52 out_old i och st.ET.t;
55 output_string och "roles:";
56 out_tag 0 "top" false map och [st]