comparison src/jscomp.sml @ 608:330a7de47914

Export RPC functions and push RPC calls through to Mono
author Adam Chlipala <adamc@hcoop.net>
date Sun, 15 Feb 2009 09:27:36 -0500
parents b1064de2b1f9
children 56aaa1941dad
comparison
equal deleted inserted replaced
607:0dd40b6bfdf3 608:330a7de47914
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 102
102 fun closedUpto d = 103 fun closedUpto d =
103 let 104 let
104 fun cu inner (e, _) = 105 fun cu inner (e, _) =
105 case e of 106 case e of
136 | EUnurlify (e, _) => cu inner e 137 | EUnurlify (e, _) => cu inner e
137 | EJavaScript (_, e, _) => cu inner e 138 | EJavaScript (_, e, _) => cu inner e
138 | ESignalReturn e => cu inner e 139 | ESignalReturn e => cu inner e
139 | ESignalBind (e1, e2) => cu inner e1 andalso cu inner e2 140 | ESignalBind (e1, e2) => cu inner e1 andalso cu inner e2
140 | ESignalSource e => cu inner e 141 | ESignalSource e => cu inner e
142 | EServerCall (_, es, ek) => List.all (cu inner) es andalso cu inner ek
141 in 143 in
142 cu 0 144 cu 0
143 end 145 end
144 146
145 fun strcat loc es = 147 fun strcat loc es =
807 (strcat [str "ss(", 809 (strcat [str "ss(",
808 e, 810 e,
809 str ")"], 811 str ")"],
810 st) 812 st)
811 end 813 end
814
815 | EServerCall _ => raise Fail "Jscomp EServerCall"
812 end 816 end
813 in 817 in
814 jsE 818 jsE
815 end 819 end
816 820