Added malloc/free with extern as well as all the other primitives and added pointer arithmatic and []

This commit is contained in:
Nathan Braswell
2016-05-15 11:09:12 -07:00
parent bdb98ed85c
commit 967ae3d68e
3 changed files with 303 additions and 60 deletions

View File

@@ -36,6 +36,12 @@ fun string_to_int(it: string): int {
return -result
return result
}
fun string_to_double(it: string): double {
var parts = it.split('.')
var divisor = 1
for (var i = 0; i < parts[1].length(); i++;) divisor *= 10
return string_to_int(parts[0]) + (string_to_int(parts[1])) cast double / divisor
}
fun to_string_num<T>(in: T): string {
if (in == 0)