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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/tools/stdtool.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/tools/stdtool.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 276 - (view) (download)

1 : blume 276 signature STDTOOL = sig
2 :     val command : string option -> string
3 :     end
4 :    
5 :     functor StdShellCmdTool
6 :     (val tool : string
7 :     val class : string
8 :     val suffixes : string list
9 :     val command : string * string
10 :     val extensionStyle : Tools.extensionStyle
11 :     val sml : bool) : STDTOOL =
12 :     struct
13 :     val command = EnvConfig.new SOME command
14 :     fun rule (f, ctxt) = let
15 :     val targetfiles = Tools.extend extensionStyle f
16 :     val mkTarget =
17 :     if sml then (fn tf => (tf, SOME "sml")) else (fn tf => (tf, NONE))
18 :     val targets = map mkTarget targetfiles
19 :     fun runcmd () = let
20 :     val cmd = concat [command NONE, " ", f]
21 :     val _ = Say.vsay (concat ["[", cmd, "]\n"])
22 :     in
23 :     if OS.Process.system cmd = OS.Process.success then ()
24 :     else raise Tools.ToolError { tool = tool, msg = cmd }
25 :     end
26 :     fun rfun () =
27 :     (if Tools.outdated tool (targetfiles, f) then runcmd () else ();
28 :     targets)
29 :     in
30 :     ctxt rfun
31 :     end
32 :    
33 :     val _ = Tools.registerClass (class, rule)
34 :    
35 :     fun sfx s =
36 :     Tools.registerClassifier
37 :     (Tools.stdSfxClassifier { sfx = s, class = class })
38 :    
39 :     val _ = app sfx suffixes
40 :     end

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