Files
corelang/program.kl

22 lines
368 B
Plaintext

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"
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]
for is_numeric(string_to_lex.str[i])
i+=1