comparison src/name_js.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 38297294cf98
children 8958b580d026
comparison
equal deleted inserted replaced
1844:2c5e6f78560c 1845:c1e3805e604e
70 | _ => free} 70 | _ => free}
71 0 71 0
72 72
73 fun rewrite file = 73 fun rewrite file =
74 let 74 let
75 val (file, _) = ListUtil.foldlMapConcat (fn (d, nextName) => 75 val (ds, _) = ListUtil.foldlMapConcat (fn (d, nextName) =>
76 let 76 let
77 val (d, (nextName, newDs)) = 77 val (d, (nextName, newDs)) =
78 U.Decl.foldMapB {typ = fn x => x, 78 U.Decl.foldMapB {typ = fn x => x,
79 decl = fn (_, e, s) => (e, s), 79 decl = fn (_, e, s) => (e, s),
80 exp = fn (env, e, st as (nextName, newDs)) => 80 exp = fn (env, e, st as (nextName, newDs)) =>
141 [] => [d] 141 [] => [d]
142 | _ => case #1 d of 142 | _ => case #1 d of
143 DValRec vis => [(DValRec (vis @ newDs), #2 d)] 143 DValRec vis => [(DValRec (vis @ newDs), #2 d)]
144 | _ => List.revAppend (map (fn vi => (DVal vi, #2 d)) newDs, [d]), 144 | _ => List.revAppend (map (fn vi => (DVal vi, #2 d)) newDs, [d]),
145 nextName) 145 nextName)
146 end) (U.File.maxName file + 1) file 146 end) (U.File.maxName file + 1) (#1 file)
147 in 147 in
148 file 148 (ds, #2 file)
149 end 149 end
150 150
151 end 151 end