summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 20:24:05 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 20:24:05 -0400
commitcf6caf0383daf8cb576edf5c1f0f736d2f4c85bd (patch)
tree5ddacbdd84964c107c03a631bf221d4fb9072691 /src/cjr_print.sml
parent811a3831805bf7a87ed3a64156f4ac6f6246edb9 (diff)
Multiple arguments to web functions
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index a3796686..991315e5 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -149,19 +149,22 @@ fun p_decl env ((d, _) : decl) =
space,
p_exp env e,
string ";"]
- | DFun (fx, n, x, dom, ran, e) =>
+ | DFun (fx, n, args, ran, e) =>
let
- val env' = E.pushERel env x dom
+ val nargs = length args
+ val env' = foldl (fn ((x, dom), env) => E.pushERel env x dom) env args
in
box [string "static",
space,
p_typ env ran,
space,
string ("__lwn_" ^ fx ^ "_" ^ Int.toString n),
- string "(lw_context ctx, ",
- p_typ env dom,
- space,
- p_rel env' 0,
+ string "(",
+ p_list_sep (box [string ",", space]) (fn x => x)
+ (string "lw_context ctx" :: ListUtil.mapi (fn (i, (_, dom)) =>
+ box [p_typ env dom,
+ space,
+ p_rel env' (nargs - i - 1)]) args),
string ")",
space,
string "{",