summaryrefslogtreecommitdiff
path: root/src/cjrize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-01-07 15:56:22 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2012-01-07 15:56:22 -0500
commit09b5839acfe26561fa87c89168133fc93c1083cc (patch)
tree587292f9b176c383c7b6332cdc30a817e355fe1d /src/cjrize.sml
parentbd78657f61d3783f9a282bf38ad0cbcb8b8bf5d4 (diff)
First part of changes to avoid depending on C function call argument order of evaluation (omitting normal Ur function calls, so far)
Diffstat (limited to 'src/cjrize.sml')
-rw-r--r--src/cjrize.sml13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cjrize.sml b/src/cjrize.sml
index 2b46c32d..a0ec2ece 100644
--- a/src/cjrize.sml
+++ b/src/cjrize.sml
@@ -277,7 +277,13 @@ fun cifyExp (eAll as (e, loc), sm) =
| L.EFfi mx => ((L'.EFfi mx, loc), sm)
| L.EFfiApp (m, x, es) =>
let
- val (es, sm) = ListUtil.foldlMap cifyExp sm es
+ val (es, sm) = ListUtil.foldlMap (fn ((e, t), sm) =>
+ let
+ val (t, sm) = cifyTyp (t, sm)
+ val (e, sm) = cifyExp (e, sm)
+ in
+ ((e, t), sm)
+ end) sm es
in
((L'.EFfiApp (m, x, es), loc), sm)
end
@@ -384,8 +390,9 @@ fun cifyExp (eAll as (e, loc), sm) =
let
val (e1, sm) = cifyExp (e1, sm)
val (e2, sm) = cifyExp (e2, sm)
+ val s = (L'.TFfi ("Basis", "string"), loc)
in
- ((L'.EFfiApp ("Basis", "strcat", [e1, e2]), loc), sm)
+ ((L'.EFfiApp ("Basis", "strcat", [(e1, s), (e2, s)]), loc), sm)
end
| L.EWrite e =>
@@ -673,7 +680,7 @@ fun cifyDecl ((d, loc), sm) =
val tk = case #1 e1 of
L.EFfi ("Basis", "initialize") => L'.Initialize
| L.EFfi ("Basis", "clientLeaves") => L'.ClientLeaves
- | L.EFfiApp ("Basis", "periodic", [(L.EPrim (Prim.Int n), _)]) => L'.Periodic n
+ | L.EFfiApp ("Basis", "periodic", [((L.EPrim (Prim.Int n), _), _)]) => L'.Periodic n
| _ => (ErrorMsg.errorAt loc "Task kind not fully determined";
L'.Initialize)
val (e, sm) = cifyExp (e, sm)