aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/test.cff
blob: f6deb67a0c834c025f4fcb108e7d0a7c9f237289 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

struct Vec2f;
struct Vec2f {
   x f32,
   y f32,
}

union Val {
   x i64,
   lo i32,
   y f64,
}

enum Color {
   Red, Green, Blue
}

static xs *void = {};

extern fn main (argc int, argv **u8) void {
   extern fn printf(fmt *const u8, ...) int;

   let colors [3]Color = { :Red, :Green, :Blue } ;
   let x = Vec2f { .y: 1, .x: 2.4 };
   printf("v = { %g, %g }\n", x.x, x.y);

   let is [10]int = { [4] = 1, 2, [1 - 1] = 3 };
   for let i = 0; i < 10; ++i {
      printf("%d\n", is[i]);
   } 

   return;
}