aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shake.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-02-14 14:07:56 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-02-14 14:07:56 -0500
commitf7db36644bdbde7b0ed48daffeb760bd5418bd2e (patch)
treed009d124587d5ea580081e4d2fccfb6ac9c21d69 /src/shake.sml
parentf75d359eeaaca5884d515380b735826532fad15c (diff)
Start of RPCification
Diffstat (limited to 'src/shake.sml')
-rw-r--r--src/shake.sml45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/shake.sml b/src/shake.sml
index e062743d..58c1d2c6 100644
--- a/src/shake.sml
+++ b/src/shake.sml
@@ -94,26 +94,31 @@ fun shake file =
and shakeCon s = U.Con.fold {kind = kind, con = con} s
fun exp (e, s) =
- case e of
- ENamed n =>
- if IS.member (#exp s, n) then
- s
- else
- let
- val s' = {exp = IS.add (#exp s, n),
- con = #con s}
- in
- (*print ("Need " ^ Int.toString n ^ "\n");*)
- case IM.find (edef, n) of
- NONE => s'
- | SOME (ns, t, e) =>
- let
- val s' = shakeExp (shakeCon s' t) e
- in
- foldl (fn (n, s') => exp (ENamed n, s')) s' ns
- end
- end
- | _ => s
+ let
+ fun check n =
+ if IS.member (#exp s, n) then
+ s
+ else
+ let
+ val s' = {exp = IS.add (#exp s, n),
+ con = #con s}
+ in
+ (*print ("Need " ^ Int.toString n ^ "\n");*)
+ case IM.find (edef, n) of
+ NONE => s'
+ | SOME (ns, t, e) =>
+ let
+ val s' = shakeExp (shakeCon s' t) e
+ in
+ foldl (fn (n, s') => exp (ENamed n, s')) s' ns
+ end
+ end
+ in
+ case e of
+ ENamed n => check n
+ | EServerCall (n, _, _) => check n
+ | _ => s
+ end
and shakeExp s = U.Exp.fold {kind = kind, con = con, exp = exp} s