diff src/jscomp.sml @ 2206:c1a62ce47083

Merge.
author Ziv Scully <ziv@mit.edu>
date Tue, 27 May 2014 21:38:01 -0400
parents 057b08253a75
children 4d64af730e35
line wrap: on
line diff
--- a/src/jscomp.sml	Tue May 27 21:15:53 2014 -0400
+++ b/src/jscomp.sml	Tue May 27 21:38:01 2014 -0400
@@ -41,6 +41,8 @@
                            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 @@
                          ((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 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 =