diff src/core_untangle.sml @ 954:2a50da66ffd8

Basic tail recursion introduction seems to be working
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Sep 2009 16:35:11 -0400
parents ef6de4075dc1
children dfe34fad749d
line wrap: on
line diff
--- a/src/core_untangle.sml	Thu Sep 17 14:57:38 2009 -0400
+++ b/src/core_untangle.sml	Thu Sep 17 16:35:11 2009 -0400
@@ -38,19 +38,20 @@
 fun default (k, s) = s
 
 fun exp thisGroup (e, s) =
-    case e of
-        ENamed n =>
-        if IS.member (thisGroup, n) then
-            IS.add (s, n)
-        else
-            s
-      | EClosure (n, _) =>
-        if IS.member (thisGroup, n) then
-            IS.add (s, n)
-        else
-            s
-
-      | _ => s
+    let
+        fun try n =
+            if IS.member (thisGroup, n) then
+                IS.add (s, n)
+            else
+                s
+    in
+        case e of
+            ENamed n => try n
+          | EClosure (n, _) => try n
+          | EServerCall (n, _, _, _, _) => try n
+          | ETailCall (n, _, _, _, _) => try n
+          | _ => s
+    end
 
 fun untangle file =
     let