summaryrefslogtreecommitdiff
path: root/tests/examplefiles/thingsdb/test.ti
blob: a45411d0ec7aaf89659847c07fe9a06686d65a46 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Multi-line comment
 */

// Single line comment

[
    0b110 & 0b011,
    0b110 | 0b011,
    0b110 ^ 0b011,
];

x = 0;
[
    false && x += 1,
    true || x += 1,
    x
];  // expression x += 1 will never be executed

0b101010;
0xff;
+0.314e+1;
nan;
-inf;
inf;
42;
-10;

!false;

true;
false;
nil;  // nil
/.*test/i;

'single quote string';
"double quote string";

nodes_info();
id();
.id();
.add(#12, #42);

variable;
.property;

|x, y| x + y;

{
    nil;  // block
}

.users.map(|user| {
    // property, with function and closure
    user.name;
});

x.y.z.filter(|| true);

.iris = {
    name: 'Iris',
    age: 6,
};

.arr = [1, 2, 3];

cato = {}

x = {
    6 * 7;  /* yes, 42 ! */
};

a == b;
a += 1;

bool = (a == b || (a == c && c != d));