comparison src/jscomp.sml @ 609:56aaa1941dad

First gimpy RPC
author Adam Chlipala <adamc@hcoop.net>
date Sun, 15 Feb 2009 10:32:50 -0500
parents 330a7de47914
children c5991cdb0c4b
comparison
equal deleted inserted replaced
608:330a7de47914 609:56aaa1941dad
96 | EUnurlify _ => 0 96 | EUnurlify _ => 0
97 | EJavaScript _ => 0 97 | EJavaScript _ => 0
98 | ESignalReturn e => varDepth e 98 | ESignalReturn e => varDepth e
99 | ESignalBind (e1, e2) => Int.max (varDepth e1, varDepth e2) 99 | ESignalBind (e1, e2) => Int.max (varDepth e1, varDepth e2)
100 | ESignalSource e => varDepth e 100 | ESignalSource e => varDepth e
101 | EServerCall (_, es, ek) => foldl Int.max (varDepth ek) (map varDepth es) 101 | EServerCall (_, es, ek, _) => foldl Int.max (varDepth ek) (map varDepth es)
102 102
103 fun closedUpto d = 103 fun closedUpto d =
104 let 104 let
105 fun cu inner (e, _) = 105 fun cu inner (e, _) =
106 case e of 106 case e of
137 | EUnurlify (e, _) => cu inner e 137 | EUnurlify (e, _) => cu inner e
138 | EJavaScript (_, e, _) => cu inner e 138 | EJavaScript (_, e, _) => cu inner e
139 | ESignalReturn e => cu inner e 139 | ESignalReturn e => cu inner e
140 | ESignalBind (e1, e2) => cu inner e1 andalso cu inner e2 140 | ESignalBind (e1, e2) => cu inner e1 andalso cu inner e2
141 | ESignalSource e => cu inner e 141 | ESignalSource e => cu inner e
142 | EServerCall (_, es, ek) => List.all (cu inner) es andalso cu inner ek 142 | EServerCall (_, es, ek, _) => List.all (cu inner) es andalso cu inner ek
143 in 143 in
144 cu 0 144 cu 0
145 end 145 end
146 146
147 fun strcat loc es = 147 fun strcat loc es =
810 e, 810 e,
811 str ")"], 811 str ")"],
812 st) 812 st)
813 end 813 end
814 814
815 | EServerCall _ => raise Fail "Jscomp EServerCall" 815 | EServerCall (x, es, ek, _) =>
816 let
817 val (ek, st) = jsE inner (ek, st)
818 in
819 (strcat [str ("rc(\"" ^ !Monoize.urlPrefix ^ x ^ "\","),
820 ek,
821 str ")"],
822 st)
823 end
816 end 824 end
817 in 825 in
818 jsE 826 jsE
819 end 827 end
820 828