src/Pure/ML/ml_compiler_polyml.ML
changeset 60956 10d463883dc2
parent 60913 7432d6bb4195
child 61715 5dc95d957569
equal deleted inserted replaced
60955:65149ae760a0 60956:10d463883dc2
   223               |> Runtime.toplevel_error (err o Runtime.exn_message)) ())));
   223               |> Runtime.toplevel_error (err o Runtime.exn_message)) ())));
   224 
   224 
   225 
   225 
   226     (* compiler invocation *)
   226     (* compiler invocation *)
   227 
   227 
       
   228     val debug =
       
   229       (case #debug flags of
       
   230         SOME debug => debug
       
   231       | NONE => ML_Options.debugger_enabled opt_context);
       
   232 
   228     val parameters =
   233     val parameters =
   229      [PolyML.Compiler.CPOutStream write,
   234      [PolyML.Compiler.CPOutStream write,
   230       PolyML.Compiler.CPNameSpace space,
   235       PolyML.Compiler.CPNameSpace space,
   231       PolyML.Compiler.CPErrorMessageProc message,
   236       PolyML.Compiler.CPErrorMessageProc message,
   232       PolyML.Compiler.CPLineNo (the_default 0 o Position.line_of o get_pos),
   237       PolyML.Compiler.CPLineNo (the_default 0 o Position.line_of o get_pos),
   233       PolyML.Compiler.CPLineOffset (the_default 0 o Position.offset_of o get_pos),
   238       PolyML.Compiler.CPLineOffset (the_default 0 o Position.offset_of o get_pos),
   234       PolyML.Compiler.CPFileName location_props,
   239       PolyML.Compiler.CPFileName location_props,
   235       PolyML.Compiler.CPPrintDepth ML_Options.get_print_depth,
   240       PolyML.Compiler.CPPrintDepth ML_Options.get_print_depth,
   236       PolyML.Compiler.CPCompilerResultFun result_fun,
   241       PolyML.Compiler.CPCompilerResultFun result_fun,
   237       PolyML.Compiler.CPPrintInAlphabeticalOrder false] @
   242       PolyML.Compiler.CPPrintInAlphabeticalOrder false] @
   238      ML_Compiler_Parameters.debug (ML_Options.debugger_enabled opt_context);
   243      ML_Compiler_Parameters.debug debug;
       
   244 
   239     val _ =
   245     val _ =
   240       (while not (List.null (! input_buffer)) do
   246       (while not (List.null (! input_buffer)) do
   241         PolyML.compiler (get, parameters) ())
   247         PolyML.compiler (get, parameters) ())
   242       handle exn =>
   248       handle exn =>
   243         if Exn.is_interrupt exn then reraise exn
   249         if Exn.is_interrupt exn then reraise exn
   255     if #verbose flags then (output_warnings (); flush_error (); output_writeln ())
   261     if #verbose flags then (output_warnings (); flush_error (); output_writeln ())
   256     else ()
   262     else ()
   257   end;
   263   end;
   258 
   264 
   259 end;
   265 end;
   260