reraise exceptions to preserve original position (ML system specific);
authorwenzelm
Thu, 04 Jun 2009 17:31:38 +0200
changeset 31427 5a07cc86675d
parent 31426 5c9dbd511510
child 31428 3b32a57b044b
reraise exceptions to preserve original position (ML system specific);
src/Pure/ML-Systems/exn.ML
src/Pure/ML-Systems/mosml.ML
src/Pure/ML-Systems/polyml-5.0.ML
src/Pure/ML-Systems/polyml-5.1.ML
src/Pure/ML-Systems/polyml-experimental.ML
src/Pure/ML-Systems/polyml.ML
src/Pure/ML-Systems/smlnj.ML
--- a/src/Pure/ML-Systems/exn.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/exn.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -35,7 +35,7 @@
 fun capture f x = Result (f x) handle e => Exn e;
 
 fun release (Result y) = y
-  | release (Exn e) = raise e;
+  | release (Exn e) = reraise e;
 
 
 (* interrupt and nested exceptions *)
@@ -58,6 +58,6 @@
     | exns => raise EXCEPTIONS exns);
 
 fun release_first results = release_all results
-  handle EXCEPTIONS (exn :: _) => raise exn;
+  handle EXCEPTIONS (exn :: _) => reraise exn;
 
 end;
--- a/src/Pure/ML-Systems/mosml.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/mosml.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -38,6 +38,7 @@
 load "CharVector";
 
 exception Interrupt;
+fun reraise exn = raise exn;
 
 use "ML-Systems/exn.ML";
 use "ML-Systems/universal.ML";
--- a/src/Pure/ML-Systems/polyml-5.0.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/polyml-5.0.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -3,6 +3,8 @@
 Compatibility wrapper for Poly/ML 5.0.
 *)
 
+fun reraise exn = raise exn;
+
 use "ML-Systems/universal.ML";
 use "ML-Systems/thread_dummy.ML";
 use "ML-Systems/ml_name_space.ML";
--- a/src/Pure/ML-Systems/polyml-5.1.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/polyml-5.1.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -3,6 +3,8 @@
 Compatibility wrapper for Poly/ML 5.1.
 *)
 
+fun reraise exn = raise exn;
+
 use "ML-Systems/thread_dummy.ML";
 use "ML-Systems/ml_name_space.ML";
 use "ML-Systems/polyml_common.ML";
--- a/src/Pure/ML-Systems/polyml-experimental.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/polyml-experimental.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -12,6 +12,11 @@
   val global = PolyML.globalNameSpace;
 end;
 
+fun reraise exn =
+  (case PolyML.exceptionLocation exn of
+    NONE => raise exn
+  | SOME location => PolyML.raiseWithLocation (exn, location));
+
 use "ML-Systems/polyml_common.ML";
 use "ML-Systems/multithreading_polyml.ML";
 
--- a/src/Pure/ML-Systems/polyml.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/polyml.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -12,6 +12,8 @@
   val global = PolyML.globalNameSpace;
 end;
 
+fun reraise exn = raise exn;
+
 use "ML-Systems/polyml_common.ML";
 
 if ml_system = "polyml-5.2"
--- a/src/Pure/ML-Systems/smlnj.ML	Thu Jun 04 17:31:37 2009 +0200
+++ b/src/Pure/ML-Systems/smlnj.ML	Thu Jun 04 17:31:38 2009 +0200
@@ -4,6 +4,7 @@
 *)
 
 exception Interrupt;
+fun reraise exn = raise exn;
 
 use "ML-Systems/proper_int.ML";
 use "ML-Systems/overloading_smlnj.ML";