summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2014-05-27 21:38:01 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2014-05-27 21:38:01 -0400
commitdc336268adfbf2b05b34ab006de5990f8ce9086c (patch)
tree22fb72ef5ad32f47571fa250515108188d7e22f9 /src/jscomp.sml
parentd941d873c0203009ccf44aa4aed97671703ca375 (diff)
parent4cee29f03879d25963e3d8a8dda879e0a007033c (diff)
Merge.
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 4a2c0365..bcabed0b 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -41,6 +41,8 @@ structure TM = BinaryMapFn(struct
val compare = U.Typ.compare
end)
+val explainEmbed = ref false
+
type state = {
decls : (string * int * (string * int * typ option) list) list,
script : string list,
@@ -267,7 +269,12 @@ fun process (file : file) =
((EApp ((ENamed n', loc), e), loc), st)
end)
- | _ => ((*Print.prefaces "Can't embed" [("t", MonoPrint.p_typ MonoEnv.empty t)];*)
+ | _ => (if !explainEmbed then
+ Print.prefaces "Can't embed" [("loc", Print.PD.string (ErrorMsg.spanToString loc)),
+ ("e", MonoPrint.p_exp MonoEnv.empty e),
+ ("t", MonoPrint.p_typ MonoEnv.empty t)]
+ else
+ ();
raise CantEmbed t)
fun unurlifyExp loc (t : typ, st) =
@@ -400,6 +407,9 @@ fun process (file : file) =
fun jsE inner (e as (_, loc), st) =
let
+ (*val () = Print.prefaces "jsExp" [("e", MonoPrint.p_exp MonoEnv.empty e),
+ ("loc", Print.PD.string (ErrorMsg.spanToString loc))]*)
+
val str = str loc
fun patCon pc =