Interpreter - Structs and Arrays

This commit is contained in:
Ginger Bill
2016-10-30 23:48:32 +00:00
parent 0ffe4b600d
commit 5271adb82f
7 changed files with 436 additions and 100 deletions
+10 -6
View File
@@ -1,11 +1,15 @@
#import "fmt.odin"
x: i64 = 123
Vec2 :: struct {
x, y: i64
}
main :: proc() {
foo :: proc(x: i64) -> i64 {
return -x + 1
bar :: proc() -> i64 {
a := [3]i64{7, 4, 2}
v := Vec2{a[0], 2}
return v.x
}
x, y: i64 = 123, 321
y = x + 2 - y
x = foo(y)
bar()
}