diff src/monoize.sml @ 718:f152f215a02c

style declarations
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Apr 2009 10:08:11 -0400
parents e28637743279
children 5c099b1308ae
line wrap: on
line diff
--- a/src/monoize.sml	Thu Apr 09 16:36:50 2009 -0400
+++ b/src/monoize.sml	Sun Apr 12 10:08:11 2009 -0400
@@ -2705,6 +2705,23 @@
                       fm,
                       [(L'.DVal (x, n, t', e, s), loc)])
             end
+          | L.DStyle (x, n, (L.CRecord (_, xcs), _), s) =>
+            let
+                val xs = map (fn ((L.CName x, _), _) => x
+                               | (x, _) => (E.errorAt (#2 x) "Undetermined style component";
+                                            Print.eprefaces' [("Name", CorePrint.p_con env x)];
+                                            "")) xcs
+
+                val t = (L.CFfi ("Basis", "string"), loc)
+                val t' = (L'.TFfi ("Basis", "string"), loc)
+                val e = (L'.EPrim (Prim.String s), loc)
+            in
+                SOME (Env.pushENamed env x n t NONE s,
+                      fm,
+                      [(L'.DStyle (s, xs), loc),
+                       (L'.DVal (x, n, t', e, s), loc)])
+            end
+          | L.DStyle _ => poly ()
     end
 
 datatype expungable = Client | Channel