comparison 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
comparison
equal deleted inserted replaced
755:58d8f877e1ee 756:8ce31c052dce
278 | eterm of exp 278 | eterm of exp
279 | etuple of exp list 279 | etuple of exp list
280 | rexp of (con * exp) list 280 | rexp of (con * exp) list
281 | xml of exp 281 | xml of exp
282 | xmlOne of exp 282 | xmlOne of exp
283 | tag of string * exp 283 | tag of (string * exp) * exp
284 | tagHead of string * exp 284 | tagHead of string * exp
285 | bind of string * con option * exp 285 | bind of string * con option * exp
286 | edecl of edecl 286 | edecl of edecl
287 | edecls of edecl list 287 | edecls of edecl list
288 288
1238 s (NOTAGSleft, NOTAGSright)) 1238 s (NOTAGSleft, NOTAGSright))
1239 | tag DIVIDE GT (let 1239 | tag DIVIDE GT (let
1240 val pos = s (tagleft, GTright) 1240 val pos = s (tagleft, GTright)
1241 1241
1242 val cdata = 1242 val cdata =
1243 if #1 tag = "submit" orelse #1 tag = "dyn" then 1243 if #1 (#1 tag) = "submit" orelse #1 (#1 tag) = "dyn" then
1244 let 1244 let
1245 val e = (EVar (["Basis"], "cdata", DontInfer), pos) 1245 val e = (EVar (["Basis"], "cdata", DontInfer), pos)
1246 val e = (ECApp (e, (CWild (KWild, pos), pos)), pos) 1246 val e = (ECApp (e, (CWild (KWild, pos), pos)), pos)
1247 in 1247 in
1248 (ECApp (e, (CRecord [], pos)), pos) 1248 (ECApp (e, (CRecord [], pos)), pos)
1259 1259
1260 | tag GT xml END_TAG (let 1260 | tag GT xml END_TAG (let
1261 val pos = s (tagleft, GTright) 1261 val pos = s (tagleft, GTright)
1262 val et = tagIn END_TAG 1262 val et = tagIn END_TAG
1263 in 1263 in
1264 if #1 tag = et then 1264 if #1 (#1 tag) = et then
1265 if et = "form" then 1265 if et = "form" then
1266 (EApp ((EVar (["Basis"], "form", Infer), pos), 1266 (EApp ((EVar (["Basis"], "form", Infer), pos),
1267 xml), pos)
1268 else if et = "subform" then
1269 (EApp ((EDisjointApp (#2 (#1 tag)), pos),
1267 xml), pos) 1270 xml), pos)
1268 else 1271 else
1269 (EApp (#2 tag, xml), pos) 1272 (EApp (#2 tag, xml), pos)
1270 else 1273 else
1271 (if ErrorMsg.anyErrors () then 1274 (if ErrorMsg.anyErrors () then
1293 val e = (EApp (e, eo), pos) 1296 val e = (EApp (e, eo), pos)
1294 val e = (EApp (e, (ERecord (#2 attrs), pos)), pos) 1297 val e = (EApp (e, (ERecord (#2 attrs), pos)), pos)
1295 val e = (EApp (e, (EApp (#2 tagHead, 1298 val e = (EApp (e, (EApp (#2 tagHead,
1296 (ERecord [], pos)), pos)), pos) 1299 (ERecord [], pos)), pos)), pos)
1297 in 1300 in
1298 (#1 tagHead, e) 1301 (tagHead, e)
1299 end) 1302 end)
1300 1303
1301 tagHead: BEGIN_TAG (let 1304 tagHead: BEGIN_TAG (let
1302 val bt = tagIn BEGIN_TAG 1305 val bt = tagIn BEGIN_TAG
1303 val pos = s (BEGIN_TAGleft, BEGIN_TAGright) 1306 val pos = s (BEGIN_TAGleft, BEGIN_TAGright)