Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/driver/main.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/driver/main.sml

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

revision 4115, Thu Jun 30 13:57:56 2016 UTC revision 4116, Thu Jun 30 14:50:25 2016 UTC
# Line 132  Line 132 
132              PhaseTimer.withTimer Timers.timeCodegen generate tree              PhaseTimer.withTimer Timers.timeCodegen generate tree
133            end            end
134    
135      fun usage (cmd, long) = TextIO.output(TextIO.stdErr, Options.usage (cmd, long))      fun usage (cmd, long, about) = (
136              TextIO.output(TextIO.stdErr, Options.usage (cmd, long));
137              if long orelse about
138                then (
139                  TextIO.output(TextIO.stdErr, "==========\n");
140                  TextIO.output(TextIO.stdErr, About.message);
141                  TextIO.output(TextIO.stdErr, "==========\n"))
142                else ())
143    
144      fun handleExn Error.ERROR = OS.Process.failure      fun handleExn Error.ERROR = OS.Process.failure
145        | handleExn exn = (        | handleExn exn = (
# Line 145  Line 152 
152    
153      fun main (name: string, args: string list) = let      fun main (name: string, args: string list) = let
154            val _ = PhaseTimer.start Timers.timeCompiler            val _ = PhaseTimer.start Timers.timeCompiler
155            val {help, version, target, defs, file} =            val {help, version, about, target, defs, file} =
156                  (Options.parseCmdLine args)                  (Options.parseCmdLine args)
157                    handle Options.Usage msg => (                    handle Options.Usage msg => (
158                      err(concat["Error: ", msg, "\n"]);                      err(concat["Error: ", msg, "\n"]);
159                      usage (name, false);                      usage (name, false, false);
160                      OS.Process.exit OS.Process.failure)                      OS.Process.exit OS.Process.failure)
161            in            in
162              Ctl.resolve();              Ctl.resolve();
163              case help              case (help, version, about)
164               of SOME long => (usage (name, long); OS.Process.success)               of (SOME long, _, _) => (usage (name, long, about); OS.Process.success)
165                | NONE => if version                | (NONE, true, false) => (print(Version.message ^ "\n"); OS.Process.success)
166                    then (print(Version.message ^ "\n"); OS.Process.success)                | (NONE, false, true) => (print(About.message ^ "\n"); OS.Process.success)
167                    else let                | (NONE, true, true) => (
168                      print(concat["Version: ", Version.message, "\n"]);
169                      print "==========\n";
170                      print About.message;
171                      print "==========\n";
172                      OS.Process.success)
173                  | _ => let
174                      val {base, ...} = OS.Path.splitBaseExt file                      val {base, ...} = OS.Path.splitBaseExt file
175                      val logging = Controls.get Ctl.enableLog                      val logging = Controls.get Ctl.enableLog
176                      in                      in

Legend:
Removed from v.4115  
changed lines
  Added in v.4116

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