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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/inputs/cmd-line-inputs.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/inputs/cmd-line-inputs.sml

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

trunk/src/compiler/common/inputs.sml revision 230, Thu Aug 5 16:00:24 2010 UTC branches/vis12/src/compiler/inputs/cmd-line-inputs.sml revision 3291, Wed Oct 14 21:25:00 2015 UTC
# Line 1  Line 1 
1  (* inputs.sml  (* cmd-line-inputs.sml
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4     *
5     * COPYRIGHT (c) 2015 The University of Chicago
6   * All rights reserved.   * All rights reserved.
7   *   *
8   * Support for processing static inputs to a program   * Support for processing static inputs to a program
9   *)   *)
10    
11  structure Inputs : sig  structure CmdLineInputs : sig
12    
13      (* returns true if the argument has the form of a command-line input specification *)
14        val isCmdLineInput : string -> bool
15    
16    (* initialize the table from the command-line arguments; returns false if there was    (* initialize the table from the command-line arguments; returns false if there was
17     * an error processing an argument.     * an error processing an argument.
# Line 27  Line 32 
32    
33      fun notEq #"=" = false | notEq _ = true      fun notEq #"=" = false | notEq _ = true
34    
35        fun isCmdLineInput s = String.isPrefix "-D" s
36    
37      fun initFromArgs args = let      fun initFromArgs args = let
38            fun doArg arg = let            fun doArg arg = let
39                  val arg = Substring.full arg                  val arg = Substring.full arg
# Line 70  Line 77 
77                            ]);                            ]);
78                          TextIO.flushOut TextIO.stdOut;                          TextIO.flushOut TextIO.stdOut;
79                          case TextIO.inputLine TextIO.stdIn                          case TextIO.inputLine TextIO.stdIn
80                           of SOME ln => (                           of SOME ln => let
81                                  val ln = String.substring(ln, 0, size ln - 1)
82                                  in
83                                AtomTable.insert inputs (name', ln);  (* cache value *)                                AtomTable.insert inputs (name', ln);  (* cache value *)
84                                cvt ln)                                  cvt ln
85                                  end
86                            | NONE => OS.Process.exit OS.Process.failure                            | NONE => OS.Process.exit OS.Process.failure
87                          (* end case *))                          (* end case *))
88                      | someVal => someVal                      | someVal => someVal

Legend:
Removed from v.230  
changed lines
  Added in v.3291

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