diff src/monoize.sml @ 200:5dbba661deab

Urlifying records
author Adam Chlipala <adamc@hcoop.net>
date Sat, 09 Aug 2008 20:08:29 -0400
parents ab86aa858e6c
children 766b5475477f
line wrap: on
line diff
--- a/src/monoize.sml	Sat Aug 09 19:46:12 2008 -0400
+++ b/src/monoize.sml	Sat Aug 09 20:08:29 2008 -0400
@@ -216,7 +216,22 @@
               | _ =>
                 case t of
                     L'.TFfi (m, x) => ((L'.EFfiApp (m, fk2s fk ^ "ify" ^ capitalize x, [e]), loc), fm)
+
                   | L'.TRecord [] => ((L'.EPrim (Prim.String ""), loc), fm)
+                  | L'.TRecord ((x, t) :: xts) =>
+                    let
+                        val (se, fm) = fooify fm ((L'.EField (e, x), loc), t)
+                    in
+                        foldl (fn ((x, t), (se, fm)) =>
+                                  let
+                                      val (se', fm) = fooify fm ((L'.EField (e, x), loc), t)
+                                  in
+                                      ((L'.EStrcat (se,
+                                                    (L'.EStrcat ((L'.EPrim (Prim.String "/"), loc),
+                                                                 se'), loc)), loc),
+                                       fm)
+                                  end) (se, fm) xts
+                    end
 
                   | L'.TDatatype (i, ref (dk, _)) =>
                     let