comparison src/monoize.sml @ 1412:5f4fee8a4dcd

Allow CSS class specification for <form>
author Adam Chlipala <adam@chlipala.net>
date Sun, 23 Jan 2011 11:18:24 -0500
parents fe470db7feea
children a8606c1cfe87
comparison
equal deleted inserted replaced
1411:38d950c06dce 1412:5f4fee8a4dcd
3388 3388
3389 | "tabl" => normal ("table", NONE, NONE) 3389 | "tabl" => normal ("table", NONE, NONE)
3390 | _ => normal (tag, NONE, NONE)) 3390 | _ => normal (tag, NONE, NONE))
3391 end 3391 end
3392 3392
3393 | L.EApp ((L.ECApp ( 3393 | L.EApp (
3394 (L.ECApp ((L.EFfi ("Basis", "form"), _), _), _), 3394 (L.EApp ((L.ECApp (
3395 (L.CRecord (_, fields), _)), _), 3395 (L.ECApp ((L.EFfi ("Basis", "form"), _), _), _),
3396 xml) => 3396 (L.CRecord (_, fields), _)), _),
3397 class), _),
3398 xml) =>
3397 let 3399 let
3398 fun findSubmit (e, _) = 3400 fun findSubmit (e, _) =
3399 case e of 3401 case e of
3400 L.EApp ( 3402 L.EApp (
3401 (L.EApp ( 3403 (L.EApp (
3516 (L'.EStrcat (action, 3518 (L'.EStrcat (action,
3517 (L'.EPrim (Prim.String " enctype=\"multipart/form-data\""), loc)), loc) 3519 (L'.EPrim (Prim.String " enctype=\"multipart/form-data\""), loc)), loc)
3518 else 3520 else
3519 action 3521 action
3520 3522
3523 val stt = (L'.TFfi ("Basis", "string"), loc)
3524 val (class, fm) = monoExp (env, st, fm) class
3525 val action = (L'.EStrcat (action,
3526 (L'.ECase (class,
3527 [((L'.PNone stt, loc),
3528 (L'.EPrim (Prim.String ""), loc)),
3529 ((L'.PSome (stt, (L'.PVar ("x", stt), loc)), loc),
3530 (L'.EStrcat ((L'.EPrim (Prim.String " class=\""), loc),
3531 (L'.EStrcat ((L'.ERel 0, loc),
3532 (L'.EPrim (Prim.String "\""), loc)), loc)), loc))],
3533 {disc = (L'.TOption stt, loc),
3534 result = stt}), loc)), loc)
3521 in 3535 in
3522 ((L'.EStrcat ((L'.EStrcat ((L'.EPrim (Prim.String "<form method=\"post\""), loc), 3536 ((L'.EStrcat ((L'.EStrcat ((L'.EPrim (Prim.String "<form method=\"post\""), loc),
3523 (L'.EStrcat (action, 3537 (L'.EStrcat (action,
3524 (L'.EPrim (Prim.String ">"), loc)), loc)), loc), 3538 (L'.EPrim (Prim.String ">"), loc)), loc)), loc),
3525 (L'.EStrcat (xml, 3539 (L'.EStrcat (xml,