# HG changeset patch # User Adam Chlipala # Date 1216570890 14400 # Node ID 6f9e224692ecfa269b6715e4435827ecf6dcefeb # Parent 63c699450281937edba07b50dfbccbc8938f18f8 Form submission type-checking diff -r 63c699450281 -r 6f9e224692ec lib/basis.lig --- a/lib/basis.lig Sun Jul 20 11:33:23 2008 -0400 +++ b/lib/basis.lig Sun Jul 20 12:21:30 2008 -0400 @@ -63,3 +63,7 @@ -> nm :: Name -> unit -> tag attrs ([LForm] ++ ctx) [] [] [nm = ty] val textbox : lformTag string [] + +val submit : ctx ::: {Unit} -> [LForm] ~ ctx + -> use ::: {Type} -> unit + -> tag [Action = $use -> page] ([LForm] ++ ctx) ([LForm] ++ ctx) use [] diff -r 63c699450281 -r 6f9e224692ec src/lacweb.grm --- a/src/lacweb.grm Sun Jul 20 11:33:23 2008 -0400 +++ b/src/lacweb.grm Sun Jul 20 12:21:30 2008 -0400 @@ -285,7 +285,6 @@ end) | LPAREN eexp RPAREN DCOLON cexp (EAnnot (eexp, cexp), s (LPARENleft, cexpright)) - | eterm DOT ident (EField (eterm, ident), s (etermleft, identright)) eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright)) @@ -297,6 +296,7 @@ | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) + | path DOT ident (EField ((EVar path, s (pathleft, pathright)), ident), s (pathleft, identright)) | FOLD (EFold, s (FOLDleft, FOLDright)) | XML_BEGIN xml XML_END (xml) diff -r 63c699450281 -r 6f9e224692ec tests/form.lac --- a/tests/form.lac Sun Jul 20 11:33:23 2008 -0400 +++ b/tests/form.lac Sun Jul 20 12:21:30 2008 -0400 @@ -1,6 +1,13 @@ +val handler = fn r => +
  • Name: {cdata r.Nam}
  • +
  • Word: {cdata r.Word}
  • + + val main : unit -> page = fn () => Name:
    - Color:
    + Word:
    + +