diff src/core_util.sml @ 182:d11754ffe252

Compiled pattern matching to C
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 12:43:20 -0400
parents 3bbed533fbd2
children 8e9f97508f0d
line wrap: on
line diff
--- a/src/core_util.sml	Sun Aug 03 11:17:33 2008 -0400
+++ b/src/core_util.sml	Sun Aug 03 12:43:20 2008 -0400
@@ -302,16 +302,18 @@
                          fn k' =>
                             (EFold k', loc))
 
-              | ECase (e, pes, t) =>
+              | ECase (e, pes, {disc, result}) =>
                 S.bind2 (mfe ctx e,
                          fn e' =>
                             S.bind2 (ListUtil.mapfold (fn (p, e) =>
                                                          S.map2 (mfe ctx e,
                                                               fn e' => (p, e'))) pes,
                                     fn pes' =>
-                                       S.map2 (mfc ctx t,
-                                               fn t' =>
-                                                  (ECase (e', pes', t'), loc))))
+                                       S.bind2 (mfc ctx disc,
+                                                fn disc' =>
+                                                   S.map2 (mfc ctx result,
+                                                        fn result' =>
+                                                           (ECase (e', pes', {disc = disc', result = result'}), loc)))))
 
               | EWrite e =>
                 S.map2 (mfe ctx e,