Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/Tools/SourceMap/gen-file.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/Tools/SourceMap/gen-file.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 751, Fri Dec 8 21:04:14 2000 UTC revision 752, Fri Dec 8 23:32:37 2000 UTC
# Line 6  Line 6 
6     val bufsize = 1024*1024     val bufsize = 1024*1024
7    
8     fun gen {trans, program, fileSuffix} (_, [infile]) =     fun gen {trans, program, fileSuffix} (_, [infile]) =
9         (let val {base, ext} = OS.Path.splitBaseExt infile         (let val _ = init()
10                val {base, ext} = OS.Path.splitBaseExt infile
11              val outfile = OS.Path.joinBaseExt{base=base, ext=SOME fileSuffix}              val outfile = OS.Path.joinBaseExt{base=base, ext=SOME fileSuffix}
12              val _ = if infile = outfile then              val _ = if infile = outfile then
13                         fail("input and output file the same name!")                         fail("input and output file the same name!")
# Line 19  Line 20 
20              in  TextIO.closeIn s;              in  TextIO.closeIn s;
21                  t <> text                  t <> text
22              end handle _ => true              end handle _ => true
23          in  if changed() then          in  if !errorCount > 0 then
24                   (print("[Result not written to "^outfile^"]\n"); 1)
25                else if changed() then
26                 (print("[Generating "^outfile^"]\n");                 (print("[Generating "^outfile^"]\n");
27                  let val s = TextIO.openOut outfile                  let val s = TextIO.openOut outfile
28                  in TextIO.output(s, text);                  in TextIO.output(s, text);
29                     TextIO.closeOut s                     TextIO.closeOut s;
30                       0
31                  end                  end
32                 )                 )
33              else              else
34                 print("[No change to "^outfile^"]\n");                 (print("[No change to "^outfile^"]\n"); 0)
             0  
35          end          end
36          handle Error => 1          handle Error => 1
37               | exn => fail("Uncaught exception "^exnName exn)               | exn => fail("Uncaught exception "^exnName exn)

Legend:
Removed from v.751  
changed lines
  Added in v.752

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0