diff -r 6a3541412b23 -r 64620f1d6f87 src/Pure/ML-Systems/polyml.ML --- a/src/Pure/ML-Systems/polyml.ML Wed Aug 17 22:25:00 2011 +0200 +++ b/src/Pure/ML-Systems/polyml.ML Wed Aug 17 23:37:23 2011 +0200 @@ -17,6 +17,22 @@ NONE => raise exn | SOME location => PolyML.raiseWithLocation (exn, location)); +fun set_exn_serial i exn = + let + val (file, startLine, endLine) = + (case PolyML.exceptionLocation exn of + NONE => ("", 0, 0) + | SOME {file, startLine, endLine, startPosition, ...} => (file, startLine, endLine)); + val location = + {file = file, startLine = startLine, endLine = endLine, + startPosition = ~ i, endPosition = 0}; + in PolyML.raiseWithLocation (exn, location) handle e => e end; + +fun get_exn_serial exn = + (case Option.map #startPosition (PolyML.exceptionLocation exn) of + NONE => NONE + | SOME i => if i >= 0 then NONE else SOME (~ i)); + use "ML-Systems/polyml_common.ML"; use "ML-Systems/multithreading_polyml.ML"; use "ML-Systems/unsynchronized.ML";