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