about summary refs log tree commit diff stats
path: root/js/baba-yaga/scratch/baba/compatibility-test.baba
blob: 4b1323194cc95238c0d3d39769a626b06b225b19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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!";