diff src/mono_util.sml @ 1073:b2311dfb3158

Initializers and setval
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Dec 2009 14:20:41 -0500
parents 217eb87dde31
children 0657e5adc938
line wrap: on
line diff
--- a/src/mono_util.sml	Sun Dec 13 13:00:55 2009 -0500
+++ b/src/mono_util.sml	Sun Dec 13 14:20:41 2009 -0500
@@ -340,6 +340,12 @@
                 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 @@
               | 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 @@
                                       | DJavaScript _ => ctx
                                       | DCookie _ => ctx
                                       | DStyle _ => ctx
+                                      | DInitializer _ => ctx
                             in
                                 S.map2 (mff ctx' ds',
                                      fn ds' =>
@@ -660,7 +671,8 @@
                           | DDatabase _ => count
                           | DJavaScript _ => count
                           | DCookie _ => count
-                          | DStyle _ => count) 0
+                          | DStyle _ => count
+                          | DInitializer _ => count) 0
 
 end