diff options
-rw-r--r-- | lib/js/urweb.js | 4 | ||||
-rw-r--r-- | lib/ur/basis.urs | 6 | ||||
-rw-r--r-- | src/jscomp.sml | 3 | ||||
-rw-r--r-- | tests/dynSpan.ur | 8 | ||||
-rw-r--r-- | tests/dynSpan.urp | 3 |
5 files changed, 21 insertions, 3 deletions
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 <xml><body> + <dyn signal={x <- signal s; return <xml><span>{[x]}</span></xml>}/> + <button onclick={x <- get s; set s (x ^ "!")}/> + </body></xml> diff --git a/tests/dynSpan.urp b/tests/dynSpan.urp new file mode 100644 index 00000000..611dc313 --- /dev/null +++ b/tests/dynSpan.urp @@ -0,0 +1,3 @@ +debug + +dynSpan |