comparison src/shake.sml @ 607:0dd40b6bfdf3

Start of RPCification
author Adam Chlipala <adamc@hcoop.net>
date Sat, 14 Feb 2009 14:07:56 -0500
parents 5c9606deacb6
children 56aaa1941dad
comparison
equal deleted inserted replaced
606:5145181b02fa 607:0dd40b6bfdf3
92 | _ => s 92 | _ => s
93 93
94 and shakeCon s = U.Con.fold {kind = kind, con = con} s 94 and shakeCon s = U.Con.fold {kind = kind, con = con} s
95 95
96 fun exp (e, s) = 96 fun exp (e, s) =
97 case e of 97 let
98 ENamed n => 98 fun check n =
99 if IS.member (#exp s, n) then 99 if IS.member (#exp s, n) then
100 s 100 s
101 else 101 else
102 let 102 let
103 val s' = {exp = IS.add (#exp s, n), 103 val s' = {exp = IS.add (#exp s, n),
104 con = #con s} 104 con = #con s}
105 in 105 in
106 (*print ("Need " ^ Int.toString n ^ "\n");*) 106 (*print ("Need " ^ Int.toString n ^ "\n");*)
107 case IM.find (edef, n) of 107 case IM.find (edef, n) of
108 NONE => s' 108 NONE => s'
109 | SOME (ns, t, e) => 109 | SOME (ns, t, e) =>
110 let 110 let
111 val s' = shakeExp (shakeCon s' t) e 111 val s' = shakeExp (shakeCon s' t) e
112 in 112 in
113 foldl (fn (n, s') => exp (ENamed n, s')) s' ns 113 foldl (fn (n, s') => exp (ENamed n, s')) s' ns
114 end 114 end
115 end 115 end
116 | _ => s 116 in
117 case e of
118 ENamed n => check n
119 | EServerCall (n, _, _) => check n
120 | _ => s
121 end
117 122
118 and shakeExp s = U.Exp.fold {kind = kind, con = con, exp = exp} s 123 and shakeExp s = U.Exp.fold {kind = kind, con = con, exp = exp} s
119 124
120 val s = {con = IS.empty, exp = IS.addList (IS.empty, page_es)} 125 val s = {con = IS.empty, exp = IS.addList (IS.empty, page_es)}
121 126