diff src/cjrize.sml @ 53:4f641f8fddaa

FFI through cjrize
author Adam Chlipala <adamc@hcoop.net>
date Sun, 22 Jun 2008 10:21:38 -0400
parents 198172560b73
children 717b6f8d8505
line wrap: on
line diff
--- a/src/cjrize.sml	Sun Jun 22 10:17:34 2008 -0400
+++ b/src/cjrize.sml	Sun Jun 22 10:21:38 2008 -0400
@@ -93,15 +93,20 @@
             ((L'.TRecord si, loc), sm)
         end
       | L.TNamed n => ((L'.TNamed n, loc), sm)
-      | L.TFfi _ => raise Fail "Cjrize TFfi"
+      | L.TFfi mx => ((L'.TFfi mx, loc), sm)
 
 fun cifyExp ((e, loc), sm) =
     case e of
         L.EPrim p => ((L'.EPrim p, loc), sm)
       | L.ERel n => ((L'.ERel n, loc), sm)
       | L.ENamed n => ((L'.ENamed n, loc), sm)
-      | L.EFfi _ => raise Fail "Cjrize EFfi"
-      | L.EFfiApp _ => raise Fail "Cjrize EFfiApp"
+      | L.EFfi mx => ((L'.EFfi mx, loc), sm)
+      | L.EFfiApp (m, x, es) =>
+        let
+            val (es, sm) = ListUtil.foldlMap cifyExp sm es
+        in
+            ((L'.EFfiApp (m, x, es), loc), sm)
+        end
       | L.ECode n => ((L'.ECode n, loc), sm)
       | L.EApp (e1, e2) =>
         let