From e74f91d28381be3758a53da75985afa05a06680d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 4 Apr 2009 11:46:24 -0400 Subject: Checking spans in dyns --- lib/js/urweb.js | 4 ++++ lib/ur/basis.urs | 6 ++++-- src/jscomp.sml | 3 ++- tests/dynSpan.ur | 8 ++++++++ tests/dynSpan.urp | 3 +++ 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 tests/dynSpan.ur create mode 100644 tests/dynSpan.urp diff --git a/lib/js/urweb.js b/lib/js/urweb.js index d3c144b9..4a447a5b 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -154,6 +154,10 @@ function pfl(s) { throw "Can't parse float: " + s; } +function cat(s1, s2) { + return s1 + s2; +} + function whine(msg) { alert(msg); throw msg; diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 586c5ef9..f95e8eba 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -375,8 +375,8 @@ con form = [Body, Form] con tabl = [Body, Table] con tr = [Body, Tr] -val dyn : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> unit - -> tag [Signal = signal (xml ctx use bind)] ctx [] use bind +val dyn : use ::: {Type} -> bind ::: {Type} -> unit + -> tag [Signal = signal (xml body use bind)] body [] use bind val head : unit -> tag [] html head [] [] val title : unit -> tag [] head [] [] [] @@ -393,6 +393,8 @@ con bodyTagStandalone = fn (attrs :: {Type}) => val br : bodyTagStandalone [] +val span : bodyTag [] + val p : bodyTag [] val b : bodyTag [] val i : bodyTag [] diff --git a/src/jscomp.sml b/src/jscomp.sml index a487eeab..934b9945 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -49,7 +49,8 @@ val funcs = [(("Basis", "alert"), "alert"), (("Basis", "urlifyInt"), "ts"), (("Basis", "urlifyFloat"), "ts"), (("Basis", "urlifyString"), "uf"), - (("Basis", "recv"), "rv")] + (("Basis", "recv"), "rv"), + (("Basis", "strcat"), "cat")] structure FM = BinaryMapFn(struct type ord_key = string * string diff --git a/tests/dynSpan.ur b/tests/dynSpan.ur new file mode 100644 index 00000000..123adde2 --- /dev/null +++ b/tests/dynSpan.ur @@ -0,0 +1,8 @@ +val x = 1 + +fun main () : transaction page = + s <- source "!"; + return + {[x]}}/> +