diff options
| author | 2022-08-22 13:07:35 +0200 | |
|---|---|---|
| committer | 2022-08-22 13:07:35 +0200 | |
| commit | e0686f7953bbc74ff03a7a6b22c0b82995ab494e (patch) | |
| tree | 96a0063c441bc6e63b13fbbda5980a8557883614 /examples | |
| parent | c9bcf39a2ad78c7bc9cbfaab43e03771899cfa44 (diff) | |
screw it , llvm
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/hello-world.cff | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/examples/hello-world.cff b/examples/hello-world.cff index ba16752..a867cd9 100644 --- a/examples/hello-world.cff +++ b/examples/hello-world.cff @@ -1,7 +1,32 @@ import "libc.hff"; +fn zero() int { + return 1 + 2; +} + +#{ +struct Vec2f { x f32, y f32 } + +fn x(v *Vec2f) f32 { + return (*v).y; +} + +fn len(x [#]int) int { + return x.#len; +} + +fn ptr(x [#]int) int { + return *x.#ptr; +} +} + +fn add(a int, b int) int { + let x *void = {}; + return a + b; +} + extern fn main(argc int, argv **u8) int { - let it = *argv = "hi"; + let it int = 0; argv[42] - 3; while argc > 0 { argc = argc - 1; |