diff options
Diffstat (limited to 'bootstrap/test.cff')
| -rw-r--r-- | bootstrap/test.cff | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/bootstrap/test.cff b/bootstrap/test.cff index ba47c6d..d962b16 100644 --- a/bootstrap/test.cff +++ b/bootstrap/test.cff @@ -1,7 +1,30 @@ -typedef v3f ["!"[~-1] - 30]f32; +typedef v3f ["!"[~-1] - as(int)30.0]f32; + +enum Color { + Red = 7, + Green = -10, + Blue, +} + +fn best() Color { + return :Green; +} + +fn hex(c Color) u32 { + switch (c) { + case :Red do return 0xFF0000; + case :Green do return 0x00FF00; + case :Blue do return 0x0000FF; + } +} 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)); return; } |