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.sml23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index a1d5ed2c..6a5116ce 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -1849,6 +1849,20 @@ fun p_exp' par env (e, loc) =
newline,
string "})"]
+ | ESetval {seq, count} =>
+ box [string "({",
+ newline,
+
+ #setval (Settings.currentDbms ()) {loc = loc,
+ seqE = p_exp env seq,
+ count = p_exp env count},
+ newline,
+ newline,
+
+ string "uw_unit_v;",
+ newline,
+ string "})"]
+
| EUnurlify (e, t) =>
let
fun getIt () =
@@ -2085,6 +2099,8 @@ fun p_decl env (dAll as (d, _) : decl) =
space,
string "*/"]
+ | DInitializer _ => box []
+
datatype 'a search =
Found of 'a
| NotFound
@@ -2716,6 +2732,8 @@ fun p_file env (ds, ps) =
newline],
string "}",
newline]
+
+ val initializers = List.mapPartial (fn (DInitializer e, _) => SOME e | _ => NONE) ds
in
box [string "#include <stdio.h>",
newline,
@@ -2849,7 +2867,10 @@ fun p_file env (ds, ps) =
string "void uw_initializer(uw_context ctx) {",
newline,
- box [p_enamed env (!initialize),
+ box [p_list_sep (box []) (fn e => box [p_exp env e,
+ string ";",
+ newline]) initializers,
+ p_enamed env (!initialize),
string "(ctx, uw_unit_v);",
newline],
string "}",