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