Refactor pretty printing of transitions and fix some depracated function uses.
authorKim Nguyễn <kim.nguyen@lri.fr>
Wed, 12 Oct 2016 11:39:07 +0000 (13:39 +0200)
committerKim Nguyễn <kim.nguyen@lri.fr>
Wed, 12 Oct 2016 11:39:42 +0000 (13:39 +0200)
src/ata.ml
src/ata.mli
tools/xml_diff.ml

index 5f7a282..c045aaf 100644 (file)
@@ -192,24 +192,20 @@ end)
       fprintf ppf "%a, %a %s %a"
         State.print q
         QNameSet.print l
       fprintf ppf "%a, %a %s %a"
         State.print q
         QNameSet.print l
-        Pretty.double_right_arrow
+        Pretty.left_arrow
         Formula.print f
   end
 
 
 module TransList : sig
   include Hlist.S with type elt = Transition.t
         Formula.print f
   end
 
 
 module TransList : sig
   include Hlist.S with type elt = Transition.t
-  val print : Format.formatter -> ?sep:string -> t -> unit
+  val print : ?sep:string -> Format.formatter -> t -> unit
 end =
   struct
     include Hlist.Make(Transition)
 end =
   struct
     include Hlist.Make(Transition)
-    let print ppf ?(sep="\n") l =
+    let print ?(sep="\n") ppf l =
       iter (fun t ->
       iter (fun t ->
-        let q, lab, f = Transition.node t in
-        fprintf ppf "%a, %a → %a%s"
-          State.print q
-          QNameSet.print lab
-          Formula.print f sep) l
+          fprintf ppf "%a%s" Transition.print t sep) l
   end
 
 
   end
 
 
@@ -284,7 +280,7 @@ let print fmt a =
     fprintf fmt "%s, %s" s1 s2;
     fprintf fmt "%s"
       (Pretty.padding (max_pre - Pretty.length s1 - Pretty.length s2));
     fprintf fmt "%s, %s" s1 s2;
     fprintf fmt "%s"
       (Pretty.padding (max_pre - Pretty.length s1 - Pretty.length s2));
-    fprintf fmt " %s  %s@\n" Pretty.right_arrow s3;
+    fprintf fmt " %s  %s@\n" Pretty.left_arrow s3;
   ) strs_strings;
   fprintf fmt "%s@\n" line
 
   ) strs_strings;
   fprintf fmt "%s@\n" line
 
index 443bb0b..54ed1b4 100644 (file)
@@ -102,7 +102,7 @@ end
 
 module TransList : sig
   include Hlist.S with type elt = Transition.t
 
 module TransList : sig
   include Hlist.S with type elt = Transition.t
-  val print : Format.formatter -> ?sep:string -> t -> unit
+  val print : ?sep:string -> Format.formatter  -> t -> unit
 end
 (** Hashconsed lists of transitions, with a printing facility *)
 
 end
 (** Hashconsed lists of transitions, with a printing facility *)
 
index 3c9ed7c..ae4aad6 100644 (file)
@@ -66,8 +66,8 @@ let common_prefix ctx1 ctx2 len =
 
 
 let diffs fd1 fd2 =
 
 
 let diffs fd1 fd2 =
-  let buffer1 = String.create 4096 in
-  let buffer2 = String.create 4096 in
+  let buffer1 = String.make 4096 '\000' in
+  let buffer2 = String.make 4096 '\000' in
   let parser1,ctx1 = create_parser () in
   let parser2,ctx2 = create_parser () in
   let rec loop () =
   let parser1,ctx1 = create_parser () in
   let parser2,ctx2 = create_parser () in
   let rec loop () =