diff src/monoize.sml @ 141:63c699450281

Initial form support
author Adam Chlipala <adamc@hcoop.net>
date Sun, 20 Jul 2008 11:33:23 -0400
parents f214c535d253
children 4b9c2bd6157c
line wrap: on
line diff
--- a/src/monoize.sml	Sun Jul 20 10:40:25 2008 -0400
+++ b/src/monoize.sml	Sun Jul 20 11:33:23 2008 -0400
@@ -140,9 +140,7 @@
 
           | L.EApp (
             (L.ECApp (
-             (L.ECApp (
-              (L.ECApp ((L.EFfi ("Basis", "cdata"), _), _), _),
-              _), _),
+             (L.ECApp ((L.EFfi ("Basis", "cdata"), _), _), _),
              _), _),
             se) => (L'.EFfiApp ("Basis", "htmlifyString", [monoExp env se]), loc)
           | L.EApp (
@@ -234,8 +232,11 @@
 
             in
                 case xml of
-                    (L.EApp ((L.ECApp ((L.EFfi ("Basis", "cdata"), _),
-                                       _), _), (L.EPrim (Prim.String s), _)), _) =>
+                    (L.EApp ((L.ECApp (
+                              (L.ECApp ((L.EFfi ("Basis", "cdata"), _),
+                                        _), _),
+                              _), _),
+                             (L.EPrim (Prim.String s), _)), _) =>
                     if CharVector.all Char.isSpace s then
                         (L'.EStrcat (tagStart, (L'.EPrim (Prim.String "/>"), loc)), loc)
                     else
@@ -243,6 +244,14 @@
                   | _ => normal ()
             end
 
+          | L.EApp ((L.ECApp (
+                     (L.ECApp ((L.EFfi ("Basis", "lform"), _), _), _),
+                     _), _),
+                    xml) =>
+            (L'.EStrcat ((L'.EPrim (Prim.String "<form>"), loc),
+                         (L'.EStrcat (monoExp env xml,
+                                      (L'.EPrim (Prim.String "</form>"), loc)), loc)), loc)
+
           | L.EApp (e1, e2) => (L'.EApp (monoExp env e1, monoExp env e2), loc)
           | L.EAbs (x, dom, ran, e) =>
             (L'.EAbs (x, monoType env dom, monoType env ran, monoExp (Env.pushERel env x dom) e), loc)