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/cm/tools/main/private-tools.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/tools/main/private-tools.sml

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

revision 817, Fri May 4 20:49:25 2001 UTC revision 818, Fri May 4 20:58:47 2001 UTC
# Line 43  Line 43 
43    
44      type setup = string option * string option      type setup = string option * string option
45    
46        type splitting = int option option
47    
48      type expansion =      type expansion =
49           { smlfiles: (srcpath * Sharing.request * setup) list,           { smlfiles: (srcpath * Sharing.request * setup * splitting) list,
50             cmfiles: (srcpath * Version.t option * rebindings) list,             cmfiles: (srcpath * Version.t option * rebindings) list,
51             sources: (srcpath * { class: string, derived: bool}) list }             sources: (srcpath * { class: string, derived: bool}) list }
52    
# Line 269  Line 271 
271          val tool = "sml"          val tool = "sml"
272          fun err s = raise ToolError { tool = tool, msg = s }          fun err s = raise ToolError { tool = tool, msg = s }
273          val kw_setup = "setup"          val kw_setup = "setup"
274          val (srq, setup) =          val kw_lambdasplit = "lambdasplit"
275            val UseDefault = NONE
276            val Suggest = SOME
277            val (srq, setup, splitting) =
278              case oto of              case oto of
279                  NONE => (Sharing.DONTCARE, (NONE, NONE))                  NONE => (Sharing.DONTCARE, (NONE, NONE), UseDefault)
280                | SOME to => let                | SOME to => let
281                      val { matches, restoptions } =                      val { matches, restoptions } =
282                          parseOptions { tool = tool,                          parseOptions { tool = tool,
283                                         keywords = [kw_setup],                                         keywords = [kw_setup, kw_lambdasplit],
284                                         options = to }                                         options = to }
285                      val srq =                      val srq =
286                          case restoptions of                          case restoptions of
# Line 304  Line 309 
309                                               opts = [STRING pre] }]) =>                                               opts = [STRING pre] }]) =>
310                              (SOME (#name pre), SOME (#name post))                              (SOME (#name pre), SOME (#name post))
311                            | _ => err "invalid setup spec"                            | _ => err "invalid setup spec"
312                        val splitting = let
313                            fun invalid () = err "invalid lambdasplit spec"
314                            fun spec (s: fnspec) =
315                                case #name s of
316                                    "default" => UseDefault
317                                  | "on" => Suggest (SOME 0)
318                                  | "off" => Suggest NONE
319                                  | "infinity" => Suggest (SOME 100000000)
320                                  | n =>
321                                    (case Int.fromString n of
322                                         SOME i => Suggest (SOME i)
323                                       | NONE => invalid ())
324                        in
325                            case matches kw_lambdasplit of
326                                NONE => UseDefault
327                              | SOME [] => Suggest (SOME 0)(* == "on" *)
328                              | SOME [STRING x] => spec x
329                              | _ => err "invalid lambdasplit spec"
330                        end
331                  in                  in
332                      (srq, setup)                      (srq, setup, splitting)
333                  end                  end
334          val p = srcpath (mkpath ())          val p = srcpath (mkpath ())
335      in      in
336          ({ smlfiles = [(p, srq, setup)],          ({ smlfiles = [(p, srq, setup, splitting)],
337             sources = [(p, { class = "sml", derived = derived })],             sources = [(p, { class = "sml", derived = derived })],
338             cmfiles = [] },             cmfiles = [] },
339           [])           [])

Legend:
Removed from v.817  
changed lines
  Added in v.818

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