src/Pure/System/isabelle_process.ML
changeset 54671 d64a4ef26edb
parent 54649 99b9249b3e05
parent 54387 890e983cb07b
child 55387 51f0876f61df
equal deleted inserted replaced
54670:cfb21e03fe2a 54671:d64a4ef26edb
   117       (fn props => fn s => standard_message (props @ serial_props ()) Markup.resultN s);
   117       (fn props => fn s => standard_message (props @ serial_props ()) Markup.resultN s);
   118     Output.Internal.writeln_fn := (fn s => standard_message (serial_props ()) Markup.writelnN s);
   118     Output.Internal.writeln_fn := (fn s => standard_message (serial_props ()) Markup.writelnN s);
   119     Output.Internal.tracing_fn :=
   119     Output.Internal.tracing_fn :=
   120       (fn s => (update_tracing (); standard_message (serial_props ()) Markup.tracingN s));
   120       (fn s => (update_tracing (); standard_message (serial_props ()) Markup.tracingN s));
   121     Output.Internal.warning_fn := (fn s => standard_message (serial_props ()) Markup.warningN s);
   121     Output.Internal.warning_fn := (fn s => standard_message (serial_props ()) Markup.warningN s);
   122     Output.Internal.error_fn :=
   122     Output.Internal.error_message_fn :=
   123       (fn (i, s) => standard_message (Markup.serial_properties i) Markup.errorN s);
   123       (fn (i, s) => standard_message (Markup.serial_properties i) Markup.errorN s);
   124     Output.Internal.protocol_message_fn := message Markup.protocolN;
   124     Output.Internal.protocol_message_fn := message Markup.protocolN;
   125     Output.Internal.urgent_message_fn := ! Output.Internal.writeln_fn;
   125     Output.Internal.urgent_message_fn := ! Output.Internal.writeln_fn;
   126     Output.Internal.prompt_fn := ignore;
   126     Output.Internal.prompt_fn := ignore;
   127     message Markup.initN [] (Session.welcome ());
   127     message Markup.initN [] (Session.welcome ());
   165 in
   165 in
   166 
   166 
   167 fun loop channel =
   167 fun loop channel =
   168   let val continue =
   168   let val continue =
   169     (case read_command channel of
   169     (case read_command channel of
   170       [] => (Output.error_msg "Isabelle process: no input"; true)
   170       [] => (Output.error_message "Isabelle process: no input"; true)
   171     | name :: args => (task_context (fn () => run_command name args); true))
   171     | name :: args => (task_context (fn () => run_command name args); true))
   172     handle Runtime.TERMINATE => false
   172     handle Runtime.TERMINATE => false
   173       | exn => (Output.error_msg (ML_Compiler.exn_message exn) handle crash => recover crash; true);
   173       | exn => (ML_Compiler.exn_error_message exn handle crash => recover crash; true);
   174   in
   174   in
   175     if continue then loop channel
   175     if continue then loop channel
   176     else (Future.shutdown (); Execution.reset (); ())
   176     else (Future.shutdown (); Execution.reset (); ())
   177   end;
   177   end;
   178 
   178