summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 18:53:20 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-03 18:53:20 -0400
commitf946d43f10e2f78d179db30c3c9ae8dcc10f3c10 (patch)
tree96feb9219e03b0d172f13bf75f747e6f26efdefa /src/cjr_print.sml
parent3e65e1558de55a1a47a62690b48159d92a4ed072 (diff)
bool in Basis
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index d35c93fe..7ff8f60f 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -116,7 +116,7 @@ fun p_pat_preamble env (p, _) =
fun p_patCon env pc =
case pc of
PConVar n => p_con_named env n
- | PConFfi _ => raise Fail "CjrPrint PConFfi"
+ | PConFfi {mod = m, con, ...} => string ("lw_" ^ m ^ "_" ^ con)
fun p_pat (env, exit, depth) (p, _) =
case p of
@@ -276,7 +276,7 @@ fun patConInfo env pc =
("__lwd_" ^ dx ^ "_" ^ Int.toString dn,
"__lwc_" ^ x ^ "_" ^ Int.toString n)
end
- | PConFfi {mod = m, datatyp, con} =>
+ | PConFfi {mod = m, datatyp, con, ...} =>
("lw_" ^ m ^ "_" ^ datatyp,
"lw_" ^ m ^ "_" ^ con)
@@ -706,11 +706,15 @@ fun p_file env (ds, ps) =
string "}"]
end
+ fun capitalize s =
+ if s = "" then
+ ""
+ else
+ str (Char.toUpper (String.sub (s, 0))) ^ String.extract (s, 1, NONE)
+
fun unurlify (t, loc) =
case t of
- TFfi ("Basis", "int") => string "lw_unurlifyInt(&request)"
- | TFfi ("Basis", "float") => string "lw_unurlifyFloat(&request)"
- | TFfi ("Basis", "string") => string "lw_unurlifyString(ctx, &request)"
+ TFfi (m, t) => string ("lw_" ^ m ^ "_unurlify" ^ capitalize t ^ "(ctx, &request)")
| TRecord 0 => string "lw_unit_v"
| TRecord i =>