diff src/urweb.grm @ 756:8ce31c052dce

Subforms
author Adam Chlipala <adamc@hcoop.net>
date Tue, 28 Apr 2009 17:26:53 -0400
parents 8688e01ae469
children 8323c1beef2e
line wrap: on
line diff
--- a/src/urweb.grm	Tue Apr 28 15:15:21 2009 -0400
+++ b/src/urweb.grm	Tue Apr 28 17:26:53 2009 -0400
@@ -280,7 +280,7 @@
  | rexp of (con * exp) list
  | xml of exp
  | xmlOne of exp
- | tag of string * exp
+ | tag of (string * exp) * exp
  | tagHead of string * exp
  | bind of string * con option * exp
  | edecl of edecl
@@ -1240,7 +1240,7 @@
                                              val pos = s (tagleft, GTright)
 
                                              val cdata =
-                                                 if #1 tag = "submit" orelse #1 tag = "dyn" then
+                                                 if #1 (#1 tag) = "submit" orelse #1 (#1 tag) = "dyn" then
                                                      let
                                                          val e = (EVar (["Basis"], "cdata", DontInfer), pos)
                                                          val e = (ECApp (e, (CWild (KWild, pos), pos)), pos)
@@ -1261,10 +1261,13 @@
                                              val pos = s (tagleft, GTright)
                                              val et = tagIn END_TAG
                                          in
-                                             if #1 tag = et then
+                                             if #1 (#1 tag) = et then
                                                  if et = "form" then
                                                      (EApp ((EVar (["Basis"], "form", Infer), pos),
                                                             xml), pos)
+                                                 else if et = "subform" then
+                                                     (EApp ((EDisjointApp (#2 (#1 tag)), pos),
+                                                            xml), pos)
                                                  else
                                                      (EApp (#2 tag, xml), pos)
                                              else
@@ -1295,7 +1298,7 @@
                                              val e = (EApp (e, (EApp (#2 tagHead,
                                                                       (ERecord [], pos)), pos)), pos)
                                          in
-                                             (#1 tagHead, e)
+                                             (tagHead, e)
                                          end)
 
 tagHead: BEGIN_TAG                      (let