blob: e7ac2dcff6e1ab7ba819aba0b516a1fafbcbfaea (
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
31
32
33
34
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"
|