# HG changeset patch # User wenzelm # Date 1244311090 -7200 # Node ID e3987b32e401075280c618b93c6b62da30cf1f9d # Parent 01e7a8bb9e5b4cce949b74d9d78cf19c8fb0de3b use_text: pass file name to compiler, tuned; diff -r 01e7a8bb9e5b -r e3987b32e401 src/Pure/ML-Systems/compiler_polyml-5.3.ML --- a/src/Pure/ML-Systems/compiler_polyml-5.3.ML Sat Jun 06 18:11:32 2009 +0200 +++ b/src/Pure/ML-Systems/compiler_polyml-5.3.ML Sat Jun 06 19:58:10 2009 +0200 @@ -14,7 +14,7 @@ fun use_text ({tune_source, name_space, str_of_pos, print, error, ...}: use_context) (start_line, name) verbose txt = let - val current_line = ref start_line; + val line = ref start_line; val in_buffer = ref (String.explode (tune_source txt)); val out_buffer = ref ([]: string list); fun output () = drop_newline (implode (rev (! out_buffer))); @@ -22,8 +22,7 @@ fun get () = (case ! in_buffer of [] => NONE - | c :: cs => - (in_buffer := cs; if c = #"\n" then current_line := ! current_line + 1 else (); SOME c)); + | c :: cs => (in_buffer := cs; if c = #"\n" then line := ! line + 1 else (); SOME c)); fun put s = out_buffer := s :: ! out_buffer; fun put_message {message = msg1, hard, location = {startLine = line, ...}, context} = (put (if hard then "Error: " else "Warning: "); @@ -33,9 +32,10 @@ val parameters = [PolyML.Compiler.CPOutStream put, - PolyML.Compiler.CPLineNo (fn () => ! current_line), + PolyML.Compiler.CPNameSpace name_space, PolyML.Compiler.CPErrorMessageProc put_message, - PolyML.Compiler.CPNameSpace name_space, + PolyML.Compiler.CPLineNo (fn () => ! line), + PolyML.Compiler.CPFileName name, PolyML.Compiler.CPPrintInAlphabeticalOrder false]; val _ = (while not (List.null (! in_buffer)) do