- eprintf "Child tags:\n%!";
- Array.iteri
- (fun tag set -> eprintf "%s: %a\n%!"
- (Tag.to_string tag) TagSet.print (TagSet.inj_positive set))
- t.children;
- eprintf "-----------------------------\n%!";
- eprintf "Descendant tags:\n%!";
- Array.iteri
- (fun tag set -> eprintf "%s: %a\n%!"
- (Tag.to_string tag) TagSet.print (TagSet.inj_positive set))
- t.descendants;
- eprintf "-----------------------------\n%!";
- eprintf "Sibling tags:\n%!";
- Array.iteri
- (fun tag set -> eprintf "%s: %a\n%!"
- (Tag.to_string tag) TagSet.print (TagSet.inj_positive set))
- t.siblings;
- eprintf "-----------------------------\n%!";
- eprintf "Following tags:\n%!";
- Array.iteri
- (fun tag set -> eprintf "%s: %a\n%!"
- (Tag.to_string tag) TagSet.print (TagSet.inj_positive set))
- t.followings;
- eprintf "-----------------------------\n%!"
-
+ let tag = ref 0 in
+ let printer ppf set =
+ Logger.print ppf "%s: %a"
+ (Tag.to_string !tag) TagSet.print (TagSet.inj_positive set);
+ incr tag
+ in
+ let set_printer msg set =
+ tag := 0;
+ Logger.print err_formatter "%s :@\n" msg;
+ Pretty.pp_print_array ~sep:pp_force_newline printer err_formatter set;
+ Logger.print err_formatter "-----------------------------@\n";
+ in
+ set_printer "Child tags" t.children;
+ set_printer "Descendant tags" t.descendants;
+ set_printer "Sibling tags" t.siblings;
+ set_printer "Following tags" t.followings