aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/mono_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 10:17:06 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-13 10:17:06 -0400
commit3316f3c317e587a5fc2ecf38f061a72b48e3b94e (patch)
treefae8c92c195e5f7976352a337017d285e729f859 /src/mono_print.sml
parent7281dbb2fc2a5f50c1049bad629f330e2ff3f7ca (diff)
Remove closure conversion in favor of zany fun with modules, which also replaces 'page'
Diffstat (limited to 'src/mono_print.sml')
-rw-r--r--src/mono_print.sml36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/mono_print.sml b/src/mono_print.sml
index 3797aefa..a936c146 100644
--- a/src/mono_print.sml
+++ b/src/mono_print.sml
@@ -62,6 +62,12 @@ fun p_typ' par env (t, _) =
and p_typ env = p_typ' false env
+fun p_enamed env n =
+ if !debug then
+ string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n)
+ else
+ string (#1 (E.lookupENamed env n))
+
fun p_exp' par env (e, _) =
case e of
EPrim p => Prim.p_t p
@@ -70,11 +76,8 @@ fun p_exp' par env (e, _) =
string (#1 (E.lookupERel env n) ^ "_" ^ Int.toString n)
else
string (#1 (E.lookupERel env n))
- | ENamed n =>
- if !debug then
- string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n)
- else
- string (#1 (E.lookupENamed env n))
+ | ENamed n => p_enamed env n
+
| EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
| EFfiApp (m, x, es) => box [string "FFI(",
string m,
@@ -131,7 +134,7 @@ and p_exp env = p_exp' false env
fun p_decl env ((d, _) : decl) =
case d of
- DVal (x, n, t, e) =>
+ DVal (x, n, t, e, s) =>
let
val xp = if !debug then
box [string x,
@@ -144,6 +147,10 @@ fun p_decl env ((d, _) : decl) =
space,
xp,
space,
+ string "as",
+ space,
+ string s,
+ space,
string ":",
space,
p_typ env t,
@@ -152,19 +159,10 @@ fun p_decl env ((d, _) : decl) =
space,
p_exp env e]
end
- | DPage (xcs, e) => box [string "page",
- string "[",
- p_list (fn (x, t) =>
- box [string x,
- space,
- string ":",
- space,
- p_typ env t]) xcs,
- string "]",
- space,
- string "=",
- space,
- p_exp env e]
+
+ | DExport n => box [string "export",
+ space,
+ p_enamed env n]
fun p_file env file =
let