tuned;
authorwenzelm
Sat, 06 Nov 2010 16:03:49 +0100
changeset 40390 5bc4336d9768
parent 40389 511e5263f5c6
child 40391 b0dafbfc05b7
tuned;
src/Pure/PIDE/document.ML
--- a/src/Pure/PIDE/document.ML	Sat Nov 06 15:34:11 2010 +0100
+++ b/src/Pure/PIDE/document.ML	Sat Nov 06 16:03:49 2010 +0100
@@ -210,6 +210,15 @@
             (fn () => Toplevel.print_state false st) ()))
   else ();
 
+fun run int tr st =
+  (case Toplevel.transition int tr st of
+    SOME (st', NONE) => ([], SOME st')
+  | SOME (_, SOME exn_info) =>
+      (case ML_Compiler.exn_messages (Runtime.EXCURSION_FAIL exn_info) of
+        [] => Exn.interrupt ()
+      | errs => (errs, NONE))
+  | NONE => ([ML_Compiler.exn_message Runtime.TERMINATE], NONE));
+
 in
 
 fun run_command thy_name tr st =
@@ -220,14 +229,7 @@
     Exn.Result () =>
       let
         val int = is_some (Toplevel.init_of tr);
-        val (errs, result) =
-          (case Toplevel.transition int tr st of
-            SOME (st', NONE) => ([], SOME st')
-          | SOME (_, SOME exn_info) =>
-              (case ML_Compiler.exn_messages (Runtime.EXCURSION_FAIL exn_info) of
-                [] => Exn.interrupt ()
-              | errs => (errs, NONE))
-          | NONE => ([ML_Compiler.exn_message Runtime.TERMINATE], NONE));
+        val (errs, result) = run int tr st;
         val _ = List.app (Toplevel.error_msg tr) errs;
         val _ =
           (case result of