Mercurial > urweb
diff src/expl_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 | 33d4a8eea484 |
children | 8e9f97508f0d |
line wrap: on
line diff
--- a/src/expl_util.sml Sun Aug 03 11:17:33 2008 -0400 +++ b/src/expl_util.sml Sun Aug 03 12:43:20 2008 -0400 @@ -287,16 +287,18 @@ fn e' => (EWrite e', 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))))) in mfe end