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/main/slave.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/main/slave.sml

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

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 666, Fri Jun 16 08:27:00 2000 UTC
# Line 11  Line 11 
11  in  in
12    structure Slave = struct    structure Slave = struct
13    
14      fun slave { pcmode, my_archos, parse, sbtrav, make } = let      fun slave { penv, my_archos, parse, sbtrav, make } = let
15    
16          val dbr = ref BtNames.dirbaseDefault          val dbr = ref BtNames.dirbaseDefault
17    
# Line 20  Line 20 
20          fun say_error () = Say.say ["SLAVE: error\n"]          fun say_error () = Say.say ["SLAVE: error\n"]
21          fun say_pong () = Say.say ["SLAVE: pong\n"]          fun say_pong () = Say.say ["SLAVE: pong\n"]
22    
23          fun path (s, pcmode) = SrcPath.fromDescr pcmode s          fun path (s, penv) = SrcPath.decode penv s
24    
25          fun chDir d =          fun chDir d =
26              OS.FileSys.chDir (SrcPath.osstring (path (d, pcmode)))              OS.FileSys.chDir (SrcPath.osstring (path (d, penv)))
27    
28          fun waitForStart () = let          fun waitForStart () = let
29              val line = TextIO.inputLine TextIO.stdIn              val line = TextIO.inputLine TextIO.stdIn
# Line 55  Line 55 
55          in          in
56              case slave archos (SOME (!dbr, f)) of              case slave archos (SOME (!dbr, f)) of
57                  NONE => (say_error (); waitForStart ())                  NONE => (say_error (); waitForStart ())
58                | SOME (g, trav, cmb_pcmode) => let                | SOME (g, trav, cmb_penv) => let
59                      val _ = say_ok ()                      val _ = say_ok ()
60                      val index = Reachable.snodeMap g                      val index = Reachable.snodeMap g
61                  in                  in
62                      workLoop (index, trav, cmb_pcmode)                      workLoop (index, trav, cmb_penv)
63                  end                  end
64          end handle _ => (say_error (); waitForStart ())          end handle _ => (say_error (); waitForStart ())
65    
66          and do_cm (archos, f) =          and do_cm (archos, f) =
67              if archos <> my_archos then (say_error (); waitForStart ())              if archos <> my_archos then (say_error (); waitForStart ())
68              else let              else let
69                  val p = path (f, pcmode)                  val p = path (f, penv)
70              in              in
71                  case parse p of                  case parse p of
72                      NONE => (say_error (); waitForStart ())                      NONE => (say_error (); waitForStart ())
# Line 76  Line 76 
76                          val trav = sbtrav () gp                          val trav = sbtrav () gp
77                          fun trav' sbn = isSome (trav sbn)                          fun trav' sbn = isSome (trav sbn)
78                      in                      in
79                          workLoop (index, trav', pcmode)                          workLoop (index, trav', penv)
80                      end                      end
81              end handle _ => (say_error (); waitForStart ())              end handle _ => (say_error (); waitForStart ())
82    
83          and workLoop (index, trav, pcmode) = let          and workLoop (index, trav, penv) = let
84              fun loop () = let              fun loop () = let
85                  val line = TextIO.inputLine TextIO.stdIn                  val line = TextIO.inputLine TextIO.stdIn
86              in              in
# Line 88  Line 88 
88                  else case String.tokens Char.isSpace line of                  else case String.tokens Char.isSpace line of
89                      ["cd", d] => (chDir d; say_ok (); loop ())                      ["cd", d] => (chDir d; say_ok (); loop ())
90                    | ["compile", f] => let                    | ["compile", f] => let
91                          val p = path (f, pcmode)                          val p = path (f, penv)
92                      in                      in
93                          case SrcPathMap.find (index, p) of                          case SrcPathMap.find (index, p) of
94                              NONE => (say_error (); loop ())                              NONE => (say_error (); loop ())

Legend:
Removed from v.651  
changed lines
  Added in v.666

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