src/Pure/ML/ml_compiler.ML
changeset 56304 40274e4f5ebf
parent 56303 4cc3f4db3447
child 56618 874bdedb2313
--- a/src/Pure/ML/ml_compiler.ML	Thu Mar 27 17:12:40 2014 +0100
+++ b/src/Pure/ML/ml_compiler.ML	Thu Mar 27 17:56:13 2014 +0100
@@ -6,22 +6,26 @@
 
 signature ML_COMPILER =
 sig
-  type flags = {SML: bool, verbose: bool}
+  type flags = {SML: bool, redirect: bool, verbose: bool}
+  val flags: flags
+  val verbose: bool -> flags -> flags
   val eval: flags -> Position.T -> ML_Lex.token list -> unit
 end
 
 structure ML_Compiler: ML_COMPILER =
 struct
 
-type flags = {SML: bool, verbose: bool};
+type flags = {SML: bool, redirect: bool, verbose: bool};
+val flags = {SML = false, redirect = false, verbose = false};
+fun verbose v (flags: flags) = {SML = #SML flags, redirect = #redirect flags, verbose = v};
 
-fun eval {SML, verbose} pos toks =
+fun eval (flags: flags) pos toks =
   let
-    val _ = if SML then error ("Standard ML is unsupported on " ^ ML_System.name) else ();
+    val _ = if #SML flags then error ("Standard ML is unsupported on " ^ ML_System.name) else ();
     val line = the_default 1 (Position.line_of pos);
     val file = the_default "ML" (Position.file_of pos);
     val text = ML_Lex.flatten toks;
-  in Secure.use_text ML_Env.local_context (line, file) verbose text end;
+  in Secure.use_text ML_Env.local_context (line, file) (#verbose flags) text end;
 
 end;