diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2016-06-25 17:39:04 +0200 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2016-06-25 17:39:04 +0200 |
commit | a10e3e0252560992128f490dfcb3d76c4bbf317b (patch) | |
tree | 019d06f96159f97869d35544042f100f2bfc0516 /ide | |
parent | 670519d2568c1a84331bd35a32b56887bb7191d9 (diff) |
[xmlproto] Remove duplicated deserialization.
Diffstat (limited to 'ide')
-rw-r--r-- | ide/xmlprotocol.ml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ide/xmlprotocol.ml b/ide/xmlprotocol.ml index d94cb0f3e..79509fe02 100644 --- a/ide/xmlprotocol.ml +++ b/ide/xmlprotocol.ml @@ -795,10 +795,11 @@ let to_message xml = match xml with Message(to_message_level lvl, to_option to_loc xloc, to_richpp content) | x -> raise (Marshal_error("message",x)) -let is_message = function - | Xml_datatype.Element ("message", [], [lvl; xloc; content]) -> - Some (to_message_level lvl, to_option to_loc xloc, to_richpp content) - | _ -> None +let is_message xml = + try begin match to_message xml with + | Message(l,c,m) -> Some (l,c,m) + | _ -> None + end with | Marshal_error _ -> None let to_feedback_content = do_match "feedback_content" (fun s a -> match s,a with | "addedaxiom", _ -> AddedAxiom |