diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-12-13 14:20:41 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-12-13 14:20:41 -0500 |
commit | b225596addee1a3cfd6c3189cff923e7f0e8f7c9 (patch) | |
tree | 14b2deefac4e078e2d5e4e5bdd076749de8659d8 /src/mono_util.sml | |
parent | 1063981355a5a041793c095c6fd89b91fa0bd579 (diff) |
Initializers and setval
Diffstat (limited to 'src/mono_util.sml')
-rw-r--r-- | src/mono_util.sml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mono_util.sml b/src/mono_util.sml index 91b4412e..184ce168 100644 --- a/src/mono_util.sml +++ b/src/mono_util.sml @@ -340,6 +340,12 @@ fun mapfoldB {typ = fc, exp = fe, bind} = S.map2 (mfe ctx e, fn e' => (ENextval e', loc)) + | ESetval (e1, e2) => + S.bind2 (mfe ctx e1, + fn e1' => + S.map2 (mfe ctx e2, + fn e2' => + (ESetval (e1', e2'), loc))) | EUnurlify (e, t) => S.bind2 (mfe ctx e, fn e' => @@ -522,6 +528,10 @@ fun mapfoldB {typ = fc, exp = fe, decl = fd, bind} = | DJavaScript _ => S.return2 dAll | DCookie _ => S.return2 dAll | DStyle _ => S.return2 dAll + | DInitializer e => + S.map2 (mfe ctx e, + fn e' => + (DInitializer e', loc)) and mfvi ctx (x, n, t, e, s) = S.bind2 (mft t, @@ -608,6 +618,7 @@ fun mapfoldB (all as {bind, ...}) = | DJavaScript _ => ctx | DCookie _ => ctx | DStyle _ => ctx + | DInitializer _ => ctx in S.map2 (mff ctx' ds', fn ds' => @@ -660,7 +671,8 @@ val maxName = foldl (fn ((d, _) : decl, count) => | DDatabase _ => count | DJavaScript _ => count | DCookie _ => count - | DStyle _ => count) 0 + | DStyle _ => count + | DInitializer _ => count) 0 end |