Skip to main content

Comprehensive test suite

The full sweep: operator precedence, unary operators, comparisons, short-circuit boolean logic, shadowing across nested scopes, while and repeat loops, and functions — including one with a boolean return value.

Arithmetic, precedence & unary operators​

let a be 2 + 3 * 4
show a // 14 — * binds tighter than +

let b be (2 + 3) * 4
show b // 20 — parens override precedence

let neg be -42
show neg // -42

let flag be not true
show flag // false

Shadowing across nested scopes​

let y be 5
if true
let y be 100
show y // 100 — the shadowed copy
show y // 5 — outer y is untouched

Functions​

define isEven taking n
return n % 2 == 0

show isEven(4) // true
show isEven(7) // false

Full expected output, in order​

14
20
1
20
-42
false
true
true
false
true
true
false
true
false
true
false
15
Hello, Antigravity!
100
5
6
1
2
3
10
120
16
30
true
false
28
999