summaryrefslogtreecommitdiff
path: root/tnslc/simple.tnsl
blob: 1d9bd30c5777b37e46d3694ffb196432d804cf6b (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

/; module mod
    uint a = 2, b = 4
    {}uint8 str = "Hello", c = "#"
    {}int arr_i = {2, 3, 4, 5} 

    struct test {
        int i, j,
        bool k,
        uint8 m
    }
;/

mod.test tv = {
    1, 2, false, 0
}

mod.test sv = {
    4, 5, true, 6
}

/; main [int]
    ~uint8 i = ~mod.str{0}
    bool b = i` > i`
    /; loop (i` < 81)
        i` = i` + 2
        /; if (i` == 80)
            i` = i` + 5
        ;/
    ;/
    return i`
;/