Passing arrays as arguments to functions working
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user