changeset 1567:5691ec310618

Basis.null
author Adam Chlipala <adam@chlipala.net>
date Thu, 06 Oct 2011 09:50:40 -0400
parents 7328dfeb7c0f
children 81d007609b1a
files lib/ur/basis.urs src/monoize.sml tests/cssNull.ur
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ur/basis.urs	Mon Sep 26 03:29:09 2011 +0400
+++ b/lib/ur/basis.urs	Thu Oct 06 09:50:40 2011 -0400
@@ -602,6 +602,8 @@
 
 type css_class
 val show_css_class : show css_class
+val null : css_class
+(* No special formatting *)
 val classes : css_class -> css_class -> css_class
 (* The equivalent of writing one class after the other, separated by a space, in
  * an HTML 'class' attribute *)
--- a/src/monoize.sml	Mon Sep 26 03:29:09 2011 +0400
+++ b/src/monoize.sml	Thu Oct 06 09:50:40 2011 -0400
@@ -2855,6 +2855,8 @@
                 ((L'.ESetval (e1, e2), loc), fm)
             end
 
+          | L.EFfi ("Basis", "null") => ((L'.EPrim (Prim.String ""), loc), fm)
+
           | L.EFfiApp ("Basis", "classes", [s1, s2]) =>
             let
                 val (s1, fm) = monoExp (env, st, fm) s1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/cssNull.ur	Thu Oct 06 09:50:40 2011 -0400
@@ -0,0 +1,6 @@
+style spicy
+
+fun main () : transaction page = return <xml><body>
+  <span class={null}>Boring</span>
+  <span class={classes null spicy}>Spicy!</span>
+</body></xml>