when statement; Better entity collection system (for both local and global); Better parsing for record declarations

This commit is contained in:
Ginger Bill
2016-11-29 23:57:06 +00:00
parent b232b9d5ea
commit d9c686b53d
9 changed files with 309 additions and 265 deletions
+9 -20
View File
@@ -1,29 +1,18 @@
// #import "fmt.odin"
#import "fmt.odin"
#import "utf8.odin"
when ODIN_OS == "window" {
when ODIN_OS != "window" {
} else {
MAX :: 64
}
#import "fmt.odin"
} else {
}
main :: proc() {
when true {
OffsetType :: type int
}
// MAX :: 64
buf: [MAX]rune
backing: [MAX]byte
offset: OffsetType
offset: int
when MAX > 0 {
msg := "Hello"
}
MAX :: 64
msg := "Hello"
count := utf8.rune_count(msg)
assert(count <= MAX)
runes := buf[:count]
@@ -33,14 +22,14 @@ main :: proc() {
s := msg[offset:]
r, len := utf8.decode_rune(s)
runes[count-i-1] = r
offset += len as OffsetType
offset += len
}
offset = 0
for i := 0; i < count; i++ {
data, len := utf8.encode_rune(runes[i])
copy(backing[offset:], data[:len])
offset += len as OffsetType
offset += len
}
reverse := backing[:offset] as string