summaryrefslogtreecommitdiff
path: root/src/core_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/core_print.sml
parent7281dbb2fc2a5f50c1049bad629f330e2ff3f7ca (diff)
Remove closure conversion in favor of zany fun with modules, which also replaces 'page'
Diffstat (limited to 'src/core_print.sml')
-rw-r--r--src/core_print.sml29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/core_print.sml b/src/core_print.sml
index be2f7387..b1cc9c2d 100644
--- a/src/core_print.sml
+++ b/src/core_print.sml
@@ -145,6 +145,13 @@ and p_name env (all as (c, _)) =
CName s => string s
| _ => p_con env all
+fun p_enamed env n =
+ (if !debug then
+ string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n)
+ else
+ string (#1 (E.lookupENamed env n)))
+ handle E.UnboundNamed _ => string ("UNBOUNDN_" ^ Int.toString n)
+
fun p_exp' par env (e, _) =
case e of
EPrim p => Prim.p_t p
@@ -154,12 +161,7 @@ fun p_exp' par env (e, _) =
else
string (#1 (E.lookupERel env n)))
handle E.UnboundRel _ => string ("UNBOUND_" ^ Int.toString n))
- | ENamed n =>
- ((if !debug then
- string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n)
- else
- string (#1 (E.lookupENamed env n)))
- handle E.UnboundNamed _ => string ("UNBOUNDN_" ^ Int.toString 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,
@@ -255,7 +257,7 @@ fun p_decl env ((d, _) : decl) =
space,
p_con env c]
end
- | DVal (x, n, t, e) =>
+ | DVal (x, n, t, e, s) =>
let
val xp = if !debug then
box [string x,
@@ -268,6 +270,10 @@ fun p_decl env ((d, _) : decl) =
space,
xp,
space,
+ string "as",
+ space,
+ string s,
+ space,
string ":",
space,
p_con env t,
@@ -276,12 +282,9 @@ fun p_decl env ((d, _) : decl) =
space,
p_exp env e]
end
- | DPage (c, e) => box [string "page",
- p_con env c,
- space,
- string "=",
- space,
- p_exp env e]
+ | DExport n => box [string "export",
+ space,
+ p_enamed env n]
fun p_file env file =
let