X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Ftatoo.ml;fp=src%2Ftatoo.ml;h=5dec2f69a7b72ed4bc5f40cc68c32ad0e91f57e2;hp=20bc903dc02620dc1e46d669f3f8c8c75b8c3ba4;hb=f41ff8d936d971eb0712e458826f6555b83746da;hpb=a96c64d15866719b4c8eb6d98ad7f1fc948e7636 diff --git a/src/tatoo.ml b/src/tatoo.ml index 20bc903..5dec2f6 100644 --- a/src/tatoo.ml +++ b/src/tatoo.ml @@ -50,7 +50,7 @@ let main () = | Some input -> let fd = open_in input in fd, fun () -> close_in fd in - let d = time Naive_tree.load_xml_file fd "parsing xml document" in + let d = time Compact_tree.load_xml_file fd "parsing xml document" in close_fd (); d in let queries = @@ -104,10 +104,10 @@ let main () = Logger.msg `STATS "@[Automaton: @\n%a@]" Ata.print auto) auto_list; end; - let module Naive = Run.Make(Naive_tree)(Naive_node_list) in + let module Naive = Run.Make(Compact_tree)(Compact_node_list) in let result_list = - let root = Naive_node_list.create () in - let () = Naive_node_list.add (Naive_tree.root doc) root in + let root = Compact_node_list.create () in + let () = Compact_node_list.add (Compact_tree.root doc) root in let f, msg = match !Options.parallel, !Options.compose with true, true -> @@ -138,11 +138,11 @@ let main () = output_string output (string_of_int !count); output_string output "\" >\n"; if !Options.count then begin - output_string output (string_of_int (Naive_node_list.length results)); + output_string output (string_of_int (Compact_node_list.length results)); output_char output '\n'; end else - Naive_node_list.iter (fun n -> - Naive_tree.print_xml output doc n; + Compact_node_list.iter (fun n -> + Compact_tree.print_xml output doc n; output_char output '\n' ) results; output_string output "\n"; @@ -166,4 +166,6 @@ let () = Some s -> ("file " ^ s) | None -> "[stdin]") msg; exit 3 | Xpath.Ulexer.Error (s, e, msg) -> eprintf "Error: character %i-%i: %s\n%!" s e msg; exit 4 - | e -> eprintf "FATAL ERROR: %s\n%!" (Printexc.to_string e); exit 128 +(* | e -> Printexc.print_backtrace stderr; + flush stderr; + eprintf "FATAL ERROR: %s\n%!" (Printexc.to_string e); exit 128 *)