# HG changeset patch # User Adam Chlipala # Date 1242492093 14400 # Node ID ef6de4075dc1fbb99f1cd965f283857d313c2a1d # Parent 5f49a6b759cb160f1689d76c31ef849e8ef8dff5 Fix a Core_untangle bug that missed closure variable references; XHTMLize diff -r 5f49a6b759cb -r ef6de4075dc1 src/cjr_print.sml --- a/src/cjr_print.sml Thu May 14 18:13:09 2009 -0400 +++ b/src/cjr_print.sml Sat May 16 12:41:33 2009 -0400 @@ -2829,7 +2829,7 @@ newline, string "uw_write_header(ctx, \"Content-script-type: text/javascript\\r\\n\");", newline, - string "uw_write(ctx, \"\");", + string "uw_write(ctx, \"\\n\");", newline, string "uw_set_script_header(ctx, \"", string (case side of diff -r 5f49a6b759cb -r ef6de4075dc1 src/core_print.sml --- a/src/core_print.sml Thu May 14 18:13:09 2009 -0400 +++ b/src/core_print.sml Sat May 16 12:41:33 2009 -0400 @@ -576,7 +576,7 @@ space, string "constraints", space, - p_exp env ce] + p_exp (E.declBinds env dAll) ce] | DSequence (x, n, s) => box [string "sequence", space, p_named x n, diff -r 5f49a6b759cb -r ef6de4075dc1 src/core_untangle.sml --- a/src/core_untangle.sml Thu May 14 18:13:09 2009 -0400 +++ b/src/core_untangle.sml Sat May 16 12:41:33 2009 -0400 @@ -44,6 +44,11 @@ IS.add (s, n) else s + | EClosure (n, _) => + if IS.member (thisGroup, n) then + IS.add (s, n) + else + s | _ => s diff -r 5f49a6b759cb -r ef6de4075dc1 src/core_util.sml --- a/src/core_util.sml Thu May 14 18:13:09 2009 -0400 +++ b/src/core_util.sml Sat May 16 12:41:33 2009 -0400 @@ -940,17 +940,25 @@ end | DExport _ => S.return2 dAll | DTable (x, n, c, s, pe, pc, ce, cc) => - S.bind2 (mfc ctx c, - fn c' => - S.bind2 (mfe ctx pe, - fn pe' => - S.bind2 (mfc ctx pc, - fn pc' => - S.bind2 (mfe ctx ce, - fn ce' => - S.map2 (mfc ctx cc, - fn cc' => - (DTable (x, n, c', s, pe', pc', ce', cc'), loc)))))) + let + val loc = #2 ce + val ct = (CFfi ("Basis", "sql_table"), loc) + val ct = (CApp (ct, (CConcat (pc, cc), loc)), loc) + val ct = (CApp (ct, cc), loc) + val ctx' = bind (ctx, NamedE (x, n, ct, NONE, s)) + in + S.bind2 (mfc ctx c, + fn c' => + S.bind2 (mfe ctx' pe, + fn pe' => + S.bind2 (mfc ctx pc, + fn pc' => + S.bind2 (mfe ctx' ce, + fn ce' => + S.map2 (mfc ctx cc, + fn cc' => + (DTable (x, n, c', s, pe', pc', ce', cc'), loc)))))) + end | DSequence _ => S.return2 dAll | DView (x, n, s, e, c) => S.bind2 (mfe ctx e, diff -r 5f49a6b759cb -r ef6de4075dc1 src/especialize.sml --- a/src/especialize.sml Thu May 14 18:13:09 2009 -0400 +++ b/src/especialize.sml Sat May 16 12:41:33 2009 -0400 @@ -348,7 +348,8 @@ (DValRec vis', _) => [(DValRec (vis @ vis'), ErrorMsg.dummySpan)] | _ => [(DValRec vis, ErrorMsg.dummySpan), d']) in - (*Print.prefaces "doDecl" [("d", CorePrint.p_decl E.empty d)];*) + (*Print.prefaces "doDecl" [("d", CorePrint.p_decl E.empty d), + ("d'", CorePrint.p_decl E.empty d')];*) (ds, ({maxName = #maxName st, funcs = funcs, decls = []}, changed)) @@ -378,7 +379,9 @@ if changed then let (*val file = ReduceLocal.reduce file*) + (*val () = Print.prefaces "Pre-untangle" [("file", CorePrint.p_file CoreEnv.empty file)]*) val file = CoreUntangle.untangle file + (*val () = Print.prefaces "Post-untangle" [("file", CorePrint.p_file CoreEnv.empty file)]*) val file = Shake.shake file in (*print "Again!\n";*) diff -r 5f49a6b759cb -r ef6de4075dc1 src/monoize.sml --- a/src/monoize.sml Thu May 14 18:13:09 2009 -0400 +++ b/src/monoize.sml Sat May 16 12:41:33 2009 -0400 @@ -2450,7 +2450,7 @@ val (ts, fm) = tagStart "input" in ((L'.EStrcat (ts, - (L'.EPrim (Prim.String (" type=\"" ^ typ ^ "\" name=\"" ^ name ^ "\"/>")), + (L'.EPrim (Prim.String (" type=\"" ^ typ ^ "\" name=\"" ^ name ^ "\" />")), loc)), loc), fm) end | _ => (Print.prefaces "Targs" (map (fn t => ("T", CorePrint.p_con env t)) targs); @@ -2486,7 +2486,7 @@ _), _), (L.EPrim (Prim.String s), _)), _) => if CharVector.all Char.isSpace s then - ((L'.EStrcat (tagStart, (L'.EPrim (Prim.String "/>"), loc)), loc), fm) + ((L'.EStrcat (tagStart, (L'.EPrim (Prim.String " />"), loc)), loc), fm) else normal () | _ => normal () @@ -2561,7 +2561,7 @@ val (ts, fm) = tagStart "input" in ((L'.EStrcat (ts, - (L'.EPrim (Prim.String (" name=\"" ^ name ^ "\"/>")), + (L'.EPrim (Prim.String (" name=\"" ^ name ^ "\" />")), loc)), loc), fm) end | SOME (_, src, _) => @@ -2632,7 +2632,7 @@ val (ts, fm) = tagStart "input" in ((L'.EStrcat (ts, - (L'.EPrim (Prim.String "/>"), loc)), + (L'.EPrim (Prim.String " />"), loc)), loc), fm) end | SOME (_, src, _) => @@ -2655,7 +2655,7 @@ val (ts, fm) = tagStart "select" in ((L'.EStrcat (ts, - (L'.EPrim (Prim.String "/>"), loc)), + (L'.EPrim (Prim.String " />"), loc)), loc), fm) end | SOME (_, src, _) =>