summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
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 "{",