* Seal the representation of states
[tatoo.git] / src / naive_tree.ml
index 33c953d..3cefe18 100644 (file)
@@ -72,7 +72,9 @@ struct
           "NODE " ^  string_of_int n.preorder)
 
   let debug_node fmt node =
-    Format.fprintf fmt "{ tag=%s; preorder=%i; data=%S; first_child=%a; next_sibling=%a; parent=%a }"
+    Format.fprintf fmt
+      "{ tag=%s; preorder=%i; data=%S;\
+first_child=%a; next_sibling=%a; parent=%a }"
       (QName.to_string node.tag)
       node.preorder
       node.data
@@ -82,7 +84,8 @@ struct
 
 
   let debug_ctx fmt ctx =
-    Format.fprintf fmt "Current context: { preorder = %i\n; stack = \n%a\n }\n-------------\n"
+    Format.fprintf fmt "Current context: { preorder = %i\n; stack = \n%a\n }\
+\n-------------\n"
       ctx.current_preorder
       (Pretty.print_list ~sep:";\n" debug_node) ctx.stack
 
@@ -208,7 +211,7 @@ struct
        Expat.final psr;
        let root = List.hd ctx.stack in
        root.next_sibling <- nil;
-       let a = Array.create ctx.current_preorder nil in
+       let a = Array.make ctx.current_preorder nil in
        let rec loop n =
          if n != nil then
            begin
@@ -241,7 +244,7 @@ struct
       Expat.Expat_error e -> error e parser_
 
   let parse_file fd =
-    let buffer = String.create 4096 in
+    let buffer = String.make 4096 '\000' in
     let parser_, finalize = create_parser () in
     let rec loop () =
       let read = input fd buffer 0 4096 in