diff options
author | 2009-01-01 11:16:57 -0500 | |
---|---|---|
committer | 2009-01-01 11:16:57 -0500 | |
commit | 783f041bd07a2a7fb308c1c7d474d8997ff5ab12 (patch) | |
tree | d9c2cf66e198b19c607a6d9076c6f32371f37b2c | |
parent | e0d59f2e5dc62dbc99a7f85197b4b3c63fcaf101 (diff) |
Reactive if
-rw-r--r-- | src/jscomp.sml | 14 | ||||
-rw-r--r-- | tests/stypes.ur | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml index ac3c9792..5e7a2673 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -170,7 +170,19 @@ fun jsExp mode skip outer = str ":", fail, str ")"] - | PCon _ => raise Fail "jsPat: PCon" + | PCon (_, PConFfi {mod = "Basis", con = "True", ...}, NONE) => + strcat [str ("(d" ^ Int.toString depth ^ "?"), + succ, + str ":", + fail, + str ")"] + | PCon (_, PConFfi {mod = "Basis", con = "False", ...}, NONE) => + strcat [str ("(d" ^ Int.toString depth ^ "?"), + fail, + str ":", + succ, + str ")"] + | PCon _ => raise Fail "PCon" | PRecord xps => let val (_, succ) = foldl diff --git a/tests/stypes.ur b/tests/stypes.ur index e5006465..c752234c 100644 --- a/tests/stypes.ur +++ b/tests/stypes.ur @@ -22,5 +22,7 @@ fun main () : transaction page = | Some n => return <xml>{[n]}</xml>}/> <a onclick={set sOpt (Some 7)}>Change</a><br/> - <dyn signal={b <- signal sBool; return <xml>{[b]}</xml>}/> <a onclick={set sBool False}>Change</a><br/> + <dyn signal={b <- signal sBool; return <xml>{[b]}</xml>}/> + <dyn signal={b <- signal sBool; if b then return <xml>Yes</xml> else return <xml>No</xml>}/> + <a onclick={set sBool False}>Change</a><br/> </body></xml> |