diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-12-20 15:17:43 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-12-20 15:17:43 -0500 |
commit | a16e550a2284ab7485429afae24f20032e5bac17 (patch) | |
tree | f9a855e7e3c71bbfd21c3657ce6a4a7bb2424bd3 /src/shake.sml | |
parent | 489ae9fdc1b78eac867252e5088baa632d85f8c9 (diff) |
Another try at reasonable Especialize, this time with a custom traversal
Diffstat (limited to 'src/shake.sml')
-rw-r--r-- | src/shake.sml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shake.sml b/src/shake.sml index d1810bea..ae3e2ea5 100644 --- a/src/shake.sml +++ b/src/shake.sml @@ -129,6 +129,9 @@ fun shake file = and shakeCon s = U.Con.fold {kind = kind, con = con} s + (*val () = print "=====\nSHAKE\n=====\n" + val current = ref 0*) + fun exp (e, s) = let fun check n = @@ -139,13 +142,16 @@ fun shake file = val s' = {exp = IS.add (#exp s, n), con = #con s} in - (*print ("Need " ^ Int.toString n ^ "\n");*) + (*print ("Need " ^ Int.toString n ^ " <-- " ^ Int.toString (!current) ^ "\n");*) case IM.find (edef, n) of NONE => s' | SOME (ns, t, e) => let + (*val old = !current + val () = current := n*) val s' = shakeExp (shakeCon s' t) e in + (*current := old;*) foldl (fn (n, s') => exp (ENamed n, s')) s' ns end end @@ -165,6 +171,7 @@ fun shake file = NONE => raise Fail "Shake: Couldn't find 'val'" | SOME (ns, t, e) => let + (*val () = current := n*) val s = shakeExp (shakeCon s t) e in foldl (fn (n, s) => exp (ENamed n, s)) s ns |