about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_nested_only.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_nested_only.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_nested_only.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_nested_only.txt b/js/scripting-lang/scratch_tests/test_nested_only.txt
new file mode 100644
index 0000000..f3857fc
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_nested_only.txt
@@ -0,0 +1,15 @@
+/* Test just the nested when expressions */
+
+/* Ensure backward compatibility with nested when expressions */
+nested_classify : x y ->
+  when x is
+    0 then when y is
+      0 then "origin"
+      _ then "on y-axis"
+    _ then when y is
+      0 then "on x-axis"
+      _ then "general position";
+
+/* Test nested when expressions */
+nested1 : nested_classify 0 0;
+..out nested1; 
\ No newline at end of file