From 4e1de854561f20e2069df271ed6f240fc521e680 Mon Sep 17 00:00:00 2001 From: ppedrot Date: Sun, 6 Nov 2011 00:15:44 +0000 Subject: Also sprach CoqIDE (in XML) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14637 85f007b7-540e-0410-9357-904b9bb8a0f7 --- tools/fake_ide.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml index 50e56d8468..6ae5f7ea70 100644 --- a/tools/fake_ide.ml +++ b/tools/fake_ide.ml @@ -12,10 +12,16 @@ exception Comment let coqtop = ref (stdin, stdout) +let p = Xml_parser.make () +let () = Xml_parser.check_eof p false + let eval_call (call:'a Ide_intf.call) = prerr_endline (Ide_intf.pr_call call); - Marshal.to_channel (snd !coqtop) call []; flush (snd !coqtop); - let res = ((Marshal.from_channel (fst !coqtop)) : 'a Ide_intf.value) in + let xml_query = Ide_intf.of_call call in + Xml_utils.print_xml (snd !coqtop) xml_query; + flush (snd !coqtop); + let xml_answer = Xml_parser.parse p (Xml_parser.SChannel (fst !coqtop)) in + let res = Ide_intf.to_answer xml_answer in prerr_endline (Ide_intf.pr_full_value call res); match res with Ide_intf.Fail _ -> exit 1 | _ -> () -- cgit v1.2.3