diff options
| author | Emilio Jesus Gallego Arias | 2016-06-01 16:51:15 +0200 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2016-06-02 16:45:39 +0200 |
| commit | ffd89ea323937b7d323e24a2b6d53cdc857117dd (patch) | |
| tree | 0e2a089a429486362bf5a4cd00e7662dee450a11 /ide/ide_slave.ml | |
| parent | e020cc70578b65609ac7337537f16a1c25254e77 (diff) | |
Encapsulate xml serialization in xmlprotocol.mli
This eases the task of replacing/improving the serializer, as well as
making it more resistant. See pitfalls below:
Main changes are:
- fold `message` type into `feedback` type
- make messages of type `Richpp.richpp` so we are explicit about the
content being a rich document.
- moved serialization functions for messages and stateid to `Xmlprotocol`
- improved a couple of internal API points (`is_message`).
Tested.
Diffstat (limited to 'ide/ide_slave.ml')
| -rw-r--r-- | ide/ide_slave.ml | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ide/ide_slave.ml b/ide/ide_slave.ml index 4b043661e0..0e09d84095 100644 --- a/ide/ide_slave.ml +++ b/ide/ide_slave.ml @@ -453,16 +453,12 @@ let print_xml = let slave_logger xml_oc level message = (* convert the message into XML *) let msg = hov 0 message in - let message = { - Feedback.message_level = level; - Feedback.message_content = (Richpp.repr (Richpp.richpp_of_pp msg)); - } in - let () = pr_debug (Printf.sprintf "-> %S" (string_of_ppcmds msg)) in - let xml = Feedback.of_message message in + let () = pr_debug (Printf.sprintf "-> %S" (string_of_ppcmds msg)) in + let xml = Xmlprotocol.of_message level (Richpp.richpp_of_pp message) in print_xml xml_oc xml let slave_feeder xml_oc msg = - let xml = Feedback.of_feedback msg in + let xml = Xmlprotocol.of_feedback msg in print_xml xml_oc xml (** The main loop *) |
