equal
deleted
inserted
replaced
115 error (output ()); Exn.reraise exn); |
115 error (output ()); Exn.reraise exn); |
116 in if verbose then print (output ()) else () end; |
116 in if verbose then print (output ()) else () end; |
117 |
117 |
118 end; |
118 end; |
119 |
119 |
120 fun ML_file context {verbose, debug} file = |
120 fun ML_file context {verbose, debug} file = Thread_Attributes.uninterruptible (fn run => fn () => |
121 let |
121 let |
122 val instream = TextIO.openIn file; |
122 val instream = TextIO.openIn file; |
123 val text = Exn.release (Exn.capture TextIO.inputAll instream before TextIO.closeIn instream); |
123 val result = Exn.capture (run TextIO.inputAll) instream; |
124 in ML context {line = 1, file = file, verbose = verbose, debug = debug} text end; |
124 val _ = TextIO.closeIn instream; |
|
125 in ML context {line = 1, file = file, verbose = verbose, debug = debug} (Exn.release result) end) (); |
125 |
126 |
126 fun ML_file_operations (f: bool option -> string -> unit) = |
127 fun ML_file_operations (f: bool option -> string -> unit) = |
127 {ML_file = f NONE, ML_file_debug = f (SOME true), ML_file_no_debug = f (SOME false)}; |
128 {ML_file = f NONE, ML_file_debug = f (SOME true), ML_file_no_debug = f (SOME false)}; |
128 |
129 |
129 |
130 |