diff options
Diffstat (limited to 'js/baba-yaga/dev/vscode/test-linting.baba')
-rw-r--r-- | js/baba-yaga/dev/vscode/test-linting.baba | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/js/baba-yaga/dev/vscode/test-linting.baba b/js/baba-yaga/dev/vscode/test-linting.baba new file mode 100644 index 0000000..e7ac2dc --- /dev/null +++ b/js/baba-yaga/dev/vscode/test-linting.baba @@ -0,0 +1,35 @@ +// Test file to verify no false linting errors +// This should not show any semicolon warnings + +// Arrow function definitions (no semicolons needed) +add : x y -> x + y; +multiply : x y -> x * y; + +// Pattern matching (no semicolons in cases) +matchValue : value -> + when value is + 42 then "The Answer" + "hello" then "Greeting" + _ then "Unknown"; + +// Table pattern matching +matchTable : table -> + when table is + { name: "Alice" age: 30 } then "Exact Table Match" + { name: "Bob" age: _ } then "Table with Wildcard Value Match" + _ then "No Table Match"; + +// List operations +numbers : [1, 2, 3, 4, 5]; +doubled : map(x -> x * 2, numbers); +filtered : filter(x -> x > 2, numbers); + +// Function calls and expressions +result : add(5, multiply(3, 4)); +greeting : str.concat("Hello", " World"); + +// No semicolon needed after these expressions +if result > 20 then + "Large result" +else + "Small result" |