src/Pure/PIDE/command.ML
changeset 67377 143665524d8e
parent 67194 1c0a6a957114
child 67381 146757999c8d
equal deleted inserted replaced
67376:d5007d93bcc6 67377:143665524d8e
   193   if Goal.future_enabled 1 andalso Keyword.is_diag keywords (Toplevel.name_of tr) then
   193   if Goal.future_enabled 1 andalso Keyword.is_diag keywords (Toplevel.name_of tr) then
   194     (Execution.fork {name = "Toplevel.diag", pos = Toplevel.pos_of tr, pri = ~1}
   194     (Execution.fork {name = "Toplevel.diag", pos = Toplevel.pos_of tr, pri = ~1}
   195       (fn () => Toplevel.command_exception int tr st); ([], SOME st))
   195       (fn () => Toplevel.command_exception int tr st); ([], SOME st))
   196   else Toplevel.command_errors int tr st;
   196   else Toplevel.command_errors int tr st;
   197 
   197 
       
   198 fun check_error e =
       
   199   (e (); []) handle exn =>
       
   200     if Exn.is_interrupt exn then Exn.reraise exn
       
   201     else Runtime.exn_messages exn;
       
   202 
   198 fun check_cmts span tr st' =
   203 fun check_cmts span tr st' =
   199   Toplevel.setmp_thread_position tr
   204   Toplevel.setmp_thread_position tr
   200     (fn () =>
   205     (fn () =>
   201       Outer_Syntax.side_comments span |> maps (fn cmt =>
   206       (span |> maps (fn tok =>
   202         (Thy_Output.output_text st' {markdown = false} (Token.input_of cmt); [])
   207         check_error (fn () => Thy_Output.check_token_comments st' tok))) @
   203           handle exn =>
   208       (Outer_Syntax.side_comments span |> maps (fn tok =>
   204             if Exn.is_interrupt exn then Exn.reraise exn
   209         check_error (fn () => Thy_Output.output_text st' {markdown = false} (Token.input_of tok)))))
   205             else Runtime.exn_messages exn)) ();
   210     ();
   206 
   211 
   207 fun report tr m =
   212 fun report tr m =
   208   Toplevel.setmp_thread_position tr (fn () => Output.report [Markup.markup_only m]) ();
   213   Toplevel.setmp_thread_position tr (fn () => Output.report [Markup.markup_only m]) ();
   209 
   214 
   210 fun status tr m =
   215 fun status tr m =