diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-03 17:14:35 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-03 17:14:35 -0400 |
commit | e2aa333c0811b2cd3003f9aac565e64f8ae37dbb (patch) | |
tree | fbf85b7af481843c62e6690911cc12e0fb028cb9 | |
parent | 411808e8dced75f376c7a95bb79d989cde704fd9 (diff) |
More fun with HTML
-rw-r--r-- | lib/basis.lig | 5 | ||||
-rw-r--r-- | src/elaborate.sml | 5 | ||||
-rw-r--r-- | src/lacweb.grm | 7 | ||||
-rw-r--r-- | tests/html.lac | 6 |
4 files changed, 21 insertions, 2 deletions
diff --git a/lib/basis.lig b/lib/basis.lig index 65dd7000..49549f5e 100644 --- a/lib/basis.lig +++ b/lib/basis.lig @@ -20,3 +20,8 @@ val join : shared :: {Unit} val head : tag [Html] [Head] val title : tag [Head] [] + +val body : tag [Html] [Body] +val p : tag [Body] [Body] +val b : tag [Body] [Body] +val i : tag [Body] [Body] diff --git a/src/elaborate.sml b/src/elaborate.sml index 7dc0f2e8..2ad3f936 100644 --- a/src/elaborate.sml +++ b/src/elaborate.sml @@ -1810,6 +1810,11 @@ fun elabDecl ((d, loc), (env, denv, gs)) = | L.DStr (x, sgno, str) => let + val () = if x = "Basis" then + raise Fail "Not allowed to redefine structure 'Basis'" + else + () + val formal = Option.map (elabSgn (env, denv)) sgno val (str', sgn', gs') = diff --git a/src/lacweb.grm b/src/lacweb.grm index 2fcc8d89..4c721cc0 100644 --- a/src/lacweb.grm +++ b/src/lacweb.grm @@ -259,7 +259,12 @@ eexp : eapps (eapps) | FN SYMBOL kcolon kind DARROW eexp (ECAbs (kcolon, SYMBOL, kind, eexp), s (FNleft, eexpright)) | FN SYMBOL COLON cexp DARROW eexp (EAbs (SYMBOL, SOME cexp, eexp), s (FNleft, eexpright)) | FN SYMBOL DARROW eexp (EAbs (SYMBOL, NONE, eexp), s (FNleft, eexpright)) - | FN cterm TWIDDLE cterm DARROW eexp(EDisjoint (cterm1, cterm2, eexp), s (cterm1left, eexpright)) + | LBRACK cterm TWIDDLE cterm RBRACK DARROW eexp(EDisjoint (cterm1, cterm2, eexp), s (LBRACKleft, RBRACKright)) + | FN UNIT DARROW eexp (let + val loc = s (FNleft, eexpright) + in + (EAbs ("_", SOME (TRecord (CRecord [], loc), loc), eexp), loc) + end) | LPAREN eexp RPAREN DCOLON cexp (EAnnot (eexp, cexp), s (LPARENleft, cexpright)) | eterm DOT ident (EField (eterm, ident), s (etermleft, identright)) diff --git a/tests/html.lac b/tests/html.lac index 6c8c743a..9b81b73d 100644 --- a/tests/html.lac +++ b/tests/html.lac @@ -1,5 +1,9 @@ -val text : xml[Html] = <html> +val main = fn () => <html> <head> <title>Hello World!</title> </head> + + <body> + <b>Hello</b> <i>World</i>! + </body> </html> |