use_text/file: tune text (cf. ML_Parse.fix_ints);
--- a/src/Pure/General/secure.ML Sun Sep 16 14:52:34 2007 +0200
+++ b/src/Pure/General/secure.ML Sun Sep 16 14:55:48 2007 +0200
@@ -37,8 +37,8 @@
fun secure_mltext () = deny_secure "Cannot evaluate ML source in secure mode";
-val orig_use_text = use_text;
-val orig_use_file = use_file;
+fun orig_use_text x = use_text ML_Parse.fix_ints x;
+fun orig_use_file x = use_file ML_Parse.fix_ints x;
fun use_text name pr verbose txt = NAMED_CRITICAL "ML" (fn () =>
(secure_mltext (); orig_use_text name pr verbose txt));
--- a/src/Pure/ML-Systems/polyml-5.0.ML Sun Sep 16 14:52:34 2007 +0200
+++ b/src/Pure/ML-Systems/polyml-5.0.ML Sun Sep 16 14:55:48 2007 +0200
@@ -11,9 +11,9 @@
(* improved versions of use_text/file *)
-fun use_text name (print, err) verbose txt =
+fun use_text (tune: string -> string) name (print, err) verbose txt =
let
- val in_buffer = ref (explode txt);
+ val in_buffer = ref (explode (tune txt));
val out_buffer = ref ([]: string list);
fun output () = implode (rev (case ! out_buffer of "\n" :: cs => cs | cs => cs));
--- a/src/Pure/ML-Systems/polyml-5.1.ML Sun Sep 16 14:52:34 2007 +0200
+++ b/src/Pure/ML-Systems/polyml-5.1.ML Sun Sep 16 14:55:48 2007 +0200
@@ -12,9 +12,9 @@
(* improved versions of use_text/file *)
-fun use_text name (print, err) verbose txt =
+fun use_text (tune: string -> string) name (print, err) verbose txt =
let
- val in_buffer = ref (explode txt);
+ val in_buffer = ref (explode (tune txt));
val out_buffer = ref ([]: string list);
fun output () = implode (rev (case ! out_buffer of "\n" :: cs => cs | cs => cs));
@@ -35,8 +35,8 @@
if verbose then print (output ()) else ()
end;
-fun use_file output verbose name =
+fun use_file tune output verbose name =
let
val instream = TextIO.openIn name;
val txt = TextIO.inputAll instream before TextIO.closeIn instream;
- in use_text name output verbose txt end;
+ in use_text tune name output verbose txt end;