Added unary ++ --, prefix and postfix, working on running a program

This commit is contained in:
Krzosa Karol
2022-06-07 09:05:02 +02:00
parent d3da979d64
commit c5b82c0532
6 changed files with 51 additions and 15 deletions

View File

@@ -3,19 +3,25 @@ Token :: struct
str: *U8
len: S64
is_numeric :: (c: U8): Bool
result := c >= '0 && c <= '9
return result
entry :: ()
string_to_lex := "Identifier 2425525 Not_Number"
token_array: [32]Token
token_count: U32
t: Token
for i := 0, i < string_to_lex.len, i+=1
if is_numeric(string_to_lex.str[i])
t.str = &string_to_lex.str[i]
t.len = i
for is_numeric(string_to_lex.str[i])
i+=1
t.len = i - t.len
token_array[token_count++] = t
token_count+=1