about summary refs log tree commit diff stats
path: root/js/scripting-lang/tests/07_case_expressions.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/tests/07_case_expressions.txt')
-rw-r--r--js/scripting-lang/tests/07_case_expressions.txt26
1 files changed, 13 insertions, 13 deletions
diff --git a/js/scripting-lang/tests/07_case_expressions.txt b/js/scripting-lang/tests/07_case_expressions.txt
index 82d458c..83bd1bb 100644
--- a/js/scripting-lang/tests/07_case_expressions.txt
+++ b/js/scripting-lang/tests/07_case_expressions.txt
@@ -3,16 +3,16 @@
 
 /* Basic case expressions */
 factorial : n -> 
-  case n of
-    0 : 1
-    _ : n * (factorial (n - 1));
+  when n is
+    0 then 1
+    _ then n * (factorial (n - 1));
 
 grade : score -> 
-  case score of
-    90 : "A"
-    80 : "B"
-    70 : "C"
-    _  : "F";
+  when score is
+    90 then "A"
+    80 then "B"
+    70 then "C"
+    _  then "F";
 
 /* Test case expressions */
 fact5 : factorial 5;
@@ -28,11 +28,11 @@ grade3 : grade 65;
 
 /* Multi-parameter case expressions */
 compare : x y -> 
-  case x y of
-    0 0 : "both zero"
-    0 _ : "x is zero"
-    _ 0 : "y is zero"
-    _ _ : "neither zero";
+  when x y is
+    0 0 then "both zero"
+    0 _ then "x is zero"
+    _ 0 then "y is zero"
+    _ _ then "neither zero";
 
 test1 : compare 0 0;
 test2 : compare 0 5;