# HG changeset patch # User wenzelm # Date 1618169529 -7200 # Node ID a5d1d1e2f1096261f3cb36f591472c300e4bb685 # Parent 225486d9c960c3e2d15e3b3bbed38cd3c5c2e4b3 tuned signature; diff -r 225486d9c960 -r a5d1d1e2f109 src/Pure/PIDE/byte_message.ML --- a/src/Pure/PIDE/byte_message.ML Sun Apr 11 21:23:51 2021 +0200 +++ b/src/Pure/PIDE/byte_message.ML Sun Apr 11 21:32:09 2021 +0200 @@ -7,6 +7,7 @@ signature BYTE_MESSAGE = sig val write: BinIO.outstream -> string list -> unit + val write_yxml: BinIO.outstream -> XML.tree -> unit val flush: BinIO.outstream -> unit val write_line: BinIO.outstream -> string -> unit val read: BinIO.instream -> int -> string @@ -25,6 +26,8 @@ fun write stream = List.app (File.output stream); +fun write_yxml stream tree = YXML.traverse (fn s => fn () => File.output stream s) tree (); + fun flush stream = ignore (try BinIO.flushOut stream); fun write_line stream s = (write stream [s, "\n"]; flush stream); diff -r 225486d9c960 -r a5d1d1e2f109 src/Pure/ROOT.ML --- a/src/Pure/ROOT.ML Sun Apr 11 21:23:51 2021 +0200 +++ b/src/Pure/ROOT.ML Sun Apr 11 21:32:09 2021 +0200 @@ -88,8 +88,8 @@ ML_file "General/timing.ML"; ML_file "General/sha1.ML"; +ML_file "PIDE/yxml.ML"; ML_file "PIDE/byte_message.ML"; -ML_file "PIDE/yxml.ML"; ML_file "PIDE/protocol_message.ML"; ML_file "PIDE/document_id.ML"; diff -r 225486d9c960 -r a5d1d1e2f109 src/Pure/System/message_channel.ML --- a/src/Pure/System/message_channel.ML Sun Apr 11 21:23:51 2021 +0200 +++ b/src/Pure/System/message_channel.ML Sun Apr 11 21:32:09 2021 +0200 @@ -48,7 +48,7 @@ and received _ (NONE :: _) = Byte_Message.flush stream | received _ (SOME (Message {body, flush}) :: rest) = let - val _ = fold (YXML.traverse (fn s => fn () => File.output stream s)) body (); + val _ = List.app (Byte_Message.write_yxml stream) body; val timeout = if flush then (Byte_Message.flush stream; NONE) else flush_timeout; in received timeout rest end | received timeout [] = continue timeout;