diff src/cjrize.sml @ 1845:c1e3805e604e

Make Scriptcheck catch more script/message-passing uses, and move the phase earlier in compilation
author Adam Chlipala <adam@chlipala.net>
date Fri, 15 Mar 2013 16:09:55 -0400
parents e8149592990e
children 98895243b5b6
line wrap: on
line diff
--- a/src/cjrize.sml	Tue Mar 12 16:21:20 2013 -0400
+++ b/src/cjrize.sml	Fri Mar 15 16:09:55 2013 -0400
@@ -694,7 +694,7 @@
       | L.DPolicy _ => (NONE, NONE, sm)
       | L.DOnError n => (SOME (L'.DOnError n, loc), NONE, sm)
 
-fun cjrize ds =
+fun cjrize (ds, sideInfo) =
     let
         val (dsF, ds, ps, sm) = foldl (fn (d, (dsF, ds, ps, sm)) =>
                                           let
@@ -722,6 +722,13 @@
                                               (dsF, ds, ps, Sm.clearDeclares sm)
                                           end)
                                       ([], [], [], Sm.empty) ds
+
+        val sideInfo = foldl (fn ((n, mode), mp) => IM.insert (mp, n, mode)) IM.empty sideInfo
+
+        val ps = map (fn (ek, s, n, ts, t, _, b) =>
+                         (ek, s, n, ts, t,
+                          getOpt (IM.find (sideInfo, n), L'.ServerOnly),
+                          b)) ps
     in
         (List.revAppend (dsF, rev ds),
          ps)