aboutsummaryrefslogtreecommitdiffstats
path: root/tests/compilation.bad
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compilation.bad')
-rw-r--r--tests/compilation.bad68
1 files changed, 40 insertions, 28 deletions
diff --git a/tests/compilation.bad b/tests/compilation.bad
index 0ffbb06..5c3b7b6 100644
--- a/tests/compilation.bad
+++ b/tests/compilation.bad
@@ -1,30 +1,42 @@
1let b = 8 1fun recur(num: int): nil {
2let a = 8 2 println("NUM: " num)
3; { 3 if num == 0 return(nil)
4; let a = 1 + 2 * 4 4 recur2(num - 1)
5; let b = 3.0 5}
6; } 6
7fun recur2(num: int): nil {
8 println("NUM: " num)
9 if num == 0 return(nil)
10 recur(num - 1)
11}
12
13recur(5)
14
15fun infrecur(msg: str num: int): nil {
16 println("NUM: " msg " " num)
17 infrecur(msg num + 1)
18}
19infrecur(" -> " 8)
7 20
81 + a 21
9; 0xf | 0xf0 22; let varint: u16 = 0x0102030405060708
10; 0xf & 0xff 23; let varfloat: f32 = 1.0
11; 0x1 << 2 24
12; 0x1 << 2 25; fun printer(): nil println("wowo!")
13; (~0xf & 0xfff << 8) == 0xfff00 26; let y = 4
14; 0xf << 4 | 0xf 27; fun nested(): nil {
15; 1 + 2 28; fun adder(a: int b: int): int {
16; 1 < 2 29; fun printer(): nil println("ho!")
17; !(1 == 0 || 1 <= 1) 30; printer()
18; 1 == 1 && 1 <= 1 31; printer()
19; !((1 * 2 * 3) * (1 * 2 * 3) >= 3 && 4 != 3 + 2) 32; printer()
20; 1 + 2 * 3 33; y + a + b
21; 1.0 + 2.0 * 3.0 34; }
22; true 35; for let i = 0, i < 2, set i += 1 {
23; false 36; println("i: " i " " adder(i, 2))
24; 0 1 37; }
25; "hello"
26; "world"
27; fun foo(): int {
28; 32
29; } 38; }
30; 1 + 2 + foo() 39
40; nested()
41; printer()
42