From 09e77eb8c7e365fc08b65f10b0b602deb782096c Mon Sep 17 00:00:00 2001 From: gareuselesinge Date: Mon, 6 May 2013 13:41:07 +0000 Subject: New module Xml_printer (dual to Xml_parser) Code for printing XML moved from xml_utils.ml to xml_printer.ml and improved to generate less garbage using Buffer.t systematically. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16480 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/fake_ide.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/fake_ide.ml') diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml index 6a4823ee0..5dcefcd88 100644 --- a/tools/fake_ide.ml +++ b/tools/fake_ide.ml @@ -12,7 +12,7 @@ exception Comment type coqtop = { in_chan : in_channel; - out_chan : out_channel; + xml_printer : Xml_printer.t; xml_parser : Xml_parser.t; } @@ -21,8 +21,7 @@ let logger level content = () let eval_call call coqtop = prerr_endline (Serialize.pr_call call); let xml_query = Serialize.of_call call in - Xml_utils.print_xml coqtop.out_chan xml_query; - flush coqtop.out_chan; + Xml_printer.print coqtop.xml_printer xml_query; let rec loop () = let xml = Xml_parser.parse coqtop.xml_parser in if Serialize.is_message xml then @@ -88,11 +87,12 @@ let main = in let coqtop = let (cin, cout) = Unix.open_process (coqtop_name^" -ideslave") in - let p = Xml_parser.make (Xml_parser.SChannel cin) in + let ip = Xml_parser.make (Xml_parser.SChannel cin) in + let op = Xml_printer.make (Xml_printer.TChannel cout) in { in_chan = cin; - out_chan = cout; - xml_parser = p; + xml_printer = op; + xml_parser = ip; } in while true do -- cgit v1.2.3