about summary refs log tree commit diff stats
path: root/js/baba-yaga/scratch/baba/compatibility-test.baba
diff options
context:
space:
mode:
Diffstat (limited to 'js/baba-yaga/scratch/baba/compatibility-test.baba')
-rw-r--r--js/baba-yaga/scratch/baba/compatibility-test.baba30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/baba-yaga/scratch/baba/compatibility-test.baba b/js/baba-yaga/scratch/baba/compatibility-test.baba
new file mode 100644
index 0000000..4b13231
--- /dev/null
+++ b/js/baba-yaga/scratch/baba/compatibility-test.baba
@@ -0,0 +1,30 @@
+// Compatibility test between optimized and legacy engines
+
+// Test variable names with underscores and numbers
+var_with_underscore : 42;
+var123 : 123;
+test_var_2 : "hello";
+
+// Test complex expressions
+result1 : var_with_underscore + var123;
+result2 : when (result1 > 100) is true then "big" _ then "small";
+
+// Test function definitions
+testFunc : a b -> a * b + var123;
+funcResult : testFunc 5 6;
+
+// Test nested when expressions
+nested : when (funcResult > 150) is 
+  true then when (var123 = 123) is true then "both true" _ then "first true"
+  _ then "first false";
+
+// Output results
+io.out "Compatibility Test Results:";
+io.out "var_with_underscore:"; io.out var_with_underscore;
+io.out "var123:"; io.out var123;  
+io.out "test_var_2:"; io.out test_var_2;
+io.out "result1:"; io.out result1;
+io.out "result2:"; io.out result2;
+io.out "funcResult:"; io.out funcResult;
+io.out "nested:"; io.out nested;
+io.out "Test complete!";