aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/test.cff
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/test.cff')
-rw-r--r--bootstrap/test.cff36
1 files changed, 17 insertions, 19 deletions
diff --git a/bootstrap/test.cff b/bootstrap/test.cff
index 89a21eb..651c2ce 100644
--- a/bootstrap/test.cff
+++ b/bootstrap/test.cff
@@ -1,30 +1,28 @@
-typedef v3f ["!"[~-1] - as(i16)30.4f64]f32;
-enum Color {
- Red = 7,
- Green = -10,
- Blue,
+struct Vec2f;
+struct Vec2f {
+ x f32,
+ y f32,
}
-fn best() Color {
- return :Green;
+union Val {
+ x i64,
+ lo i32,
+ y f64,
}
-fn hex(c Color) u32 {
- switch (c) {
- case :Red; return 0xFF0000;
- case :Green; return 0x00FF00;
- case :Blue; return 0x0000FF;
- }
-}
+static xs *void = {};
extern fn main (argc int, argv **u8) void {
extern fn printf(fmt *const u8, ...) int;
- printf("red %d\n", Color:Red);
- printf("green %d\n", Color:Green);
- printf("blue %d\n", Color:Blue);
- printf("red ! %.8X\n", hex(:Red));
-
+ 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;
}