comparison 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
comparison
equal deleted inserted replaced
1844:2c5e6f78560c 1845:c1e3805e604e
692 | _ => (ErrorMsg.errorAt loc "Initializer has not been fully determined"; 692 | _ => (ErrorMsg.errorAt loc "Initializer has not been fully determined";
693 (NONE, NONE, sm))) 693 (NONE, NONE, sm)))
694 | L.DPolicy _ => (NONE, NONE, sm) 694 | L.DPolicy _ => (NONE, NONE, sm)
695 | L.DOnError n => (SOME (L'.DOnError n, loc), NONE, sm) 695 | L.DOnError n => (SOME (L'.DOnError n, loc), NONE, sm)
696 696
697 fun cjrize ds = 697 fun cjrize (ds, sideInfo) =
698 let 698 let
699 val (dsF, ds, ps, sm) = foldl (fn (d, (dsF, ds, ps, sm)) => 699 val (dsF, ds, ps, sm) = foldl (fn (d, (dsF, ds, ps, sm)) =>
700 let 700 let
701 val (dop, pop, sm) = cifyDecl (d, sm) 701 val (dop, pop, sm) = cifyDecl (d, sm)
702 702
720 | SOME p => p :: ps 720 | SOME p => p :: ps
721 in 721 in
722 (dsF, ds, ps, Sm.clearDeclares sm) 722 (dsF, ds, ps, Sm.clearDeclares sm)
723 end) 723 end)
724 ([], [], [], Sm.empty) ds 724 ([], [], [], Sm.empty) ds
725
726 val sideInfo = foldl (fn ((n, mode), mp) => IM.insert (mp, n, mode)) IM.empty sideInfo
727
728 val ps = map (fn (ek, s, n, ts, t, _, b) =>
729 (ek, s, n, ts, t,
730 getOpt (IM.find (sideInfo, n), L'.ServerOnly),
731 b)) ps
725 in 732 in
726 (List.revAppend (dsF, rev ds), 733 (List.revAppend (dsF, rev ds),
727 ps) 734 ps)
728 end 735 end
729 736