diff src/monoize.sml @ 1272:56bd4a4f6e66

Some serious bug-fix work to get HTML example to compile; this includes fixing a bug with 'val' patterns in Unnest and the need for more local reduction in Especialize
author Adam Chlipala <adamc@hcoop.net>
date Thu, 03 Jun 2010 13:04:37 -0400
parents 459a334345ae
children 3d06e0f7a6f3
line wrap: on
line diff
--- a/src/monoize.sml	Tue Jun 01 15:46:24 2010 -0400
+++ b/src/monoize.sml	Thu Jun 03 13:04:37 2010 -0400
@@ -2737,7 +2737,7 @@
                      (L.ECApp (
                       (L.ECApp (
                        (L.EFfi ("Basis", "tag"),
-                        _), _), _), _), _), _), _), _), _), _), _), _), _), _), _), _), _),
+                        _), (L.CRecord (_, attrsGiven), _)), _), _), _), _), _), _), _), _), _), _), _), _), _), _), _),
                class), _),
               attrs), _),
              tag), _),
@@ -2768,7 +2768,10 @@
                 val (attrs, fm) = monoExp (env, st, fm) attrs
                 val attrs = case #1 attrs of
                                 L'.ERecord xes => xes
-                              | _ => raise Fail "Non-record attributes!"
+                              | _ => map (fn ((L.CName x, _), t) => (x, (L'.EField (attrs, x), loc), monoType env t)
+                                           | (c, t) => (E.errorAt loc "Non-constant field name for HTML tag attribute";
+                                                        Print.eprefaces' [("Name", CorePrint.p_con env c)];
+                                                        ("", (L'.EField (attrs, ""), loc), monoType env t))) attrsGiven
 
                 val attrs =
                     if List.exists (fn ("Link", _, _) => true