diff options
author | gareuselesinge <gareuselesinge@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-05-06 13:41:07 +0000 |
---|---|---|
committer | gareuselesinge <gareuselesinge@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-05-06 13:41:07 +0000 |
commit | 09e77eb8c7e365fc08b65f10b0b602deb782096c (patch) | |
tree | 98fe6dd79c8c47c65d67791efc93836c0fa78e1e /tools/fake_ide.ml | |
parent | 67df75285764fd0d192675cfcd3999936864d90a (diff) |
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
Diffstat (limited to 'tools/fake_ide.ml')
-rw-r--r-- | tools/fake_ide.ml | 12 |
1 files changed, 6 insertions, 6 deletions
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 |