reid-llvm/examples/reid/arithmetic.reid

14 lines
287 B
Plaintext
Raw Permalink Normal View History

2023-07-27 16:40:12 +02:00
// Arithmetic, function calls and imports!
2023-08-02 23:53:39 +02:00
fn main() {
2024-08-21 22:07:04 +02:00
let test = 9;
let simpleAdd = 2 + 2;
2024-08-21 22:31:31 +02:00
let simpleMult = 7 * 2; // 14
let arithmetic = 3 + 2 * 5 + 1 * 2; // 15
2024-08-25 21:29:45 +02:00
if simpleAdd < test {
return 3;
}
2024-08-21 22:07:04 +02:00
return arithmetic + simpleMult * arithmetic;
2023-08-02 23:53:39 +02:00
}