Passing arrays as arguments to functions working

This commit is contained in:
Krzosa Karol
2022-06-07 21:34:02 +02:00
parent b65a5f78bf
commit 5744da8899
4 changed files with 57 additions and 54 deletions

View File

@@ -19,6 +19,11 @@ is_numeric :: (c: U8): Bool
result := c >= '0 && c <= '9
return result
print_tokens :: (tokens: []Token)
for i := 0, i < tokens.len, i++
t := &tokens[i]
printf("%d. %.*s", i, cast(t.len: S32), t.str)
entry :: ()
string_to_lex := "Identifier 2425525 Not_Number"
token_array: [32]Token
@@ -34,7 +39,5 @@ entry :: ()
i+=1
t.len = i - t.len
token_array[token_count++] = t
print_tokens(token_array)
for i := 0, i < token_count, i++
tk := &token_array[i]
printf("%.*s", cast(tk.len: S32), tk.str)