about summary refs log tree commit diff
path: root/boot/tests/transpile/compound_assigns.cskt
blob: e480f31d73f616eefff29f476e8166525fe7bcc6 (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
compound assigns are desugared during lowering so the c output
only ever has plain assignments.

<<<

main = fun () {
    var x int = 0
    x += 1
    x *= 2
    x++
    x -= 3
    x--
}

>>>

#include "core.c"
void catskill_main(void);
void catskill_main(void) {
    integer x = 0;
    x = x + 1;
    x = x * 2;
    x = x + 1;
    x = x - 3;
    x = x - 1;
}
#include "runtime.c"