From 98bc0188c56d45ad9cf00296ace4ab25b52238a0 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 22 Sep 2009 15:12:09 -0400 Subject: Quoting JavaScript working --- tests/jscomp.ur | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'tests/jscomp.ur') diff --git a/tests/jscomp.ur b/tests/jscomp.ur index 1d5e3b54..e2cf4f94 100644 --- a/tests/jscomp.ur +++ b/tests/jscomp.ur @@ -6,12 +6,25 @@ fun fact n = 0 => 1 | _ => n * fact (n - 1) +datatype t = + A + | B of {C : int, D : float} + | E of t * t + +fun render x = + case x of + A => "A" + | B {C = n1, D = n2} => "B(" ^ show n1 ^ "," ^ show n2 ^ ")" + | E (x, y) => "C(" ^ render x ^ "," ^ render y ^ ")" + fun main () = s <- source ""; s' <- source ""; f <- source (plus 1); f2 <- source fst; r <- source {A = "x", B = "y"}; + t <- source (E (A, B {C = 10, D = 1.23})); + ht <- source Nothing here yet.; return

@@ -22,7 +35,10 @@ fun main () = Function2: