parse const decls

This commit is contained in:
2026-07-25 00:26:47 +02:00
parent c7f527e3c3
commit 90c7195d4b
28 changed files with 1452 additions and 1134 deletions
+32 -28
View File
@@ -1,34 +1,38 @@
import "@source/strpool"
TokenKind :: enum {
if
else
for
while
proc
return
ident
int
float
string
equal
double_colon
open_paren
close_paren
open_curly
close_curly
newline
invalid
eof
}
Token :: struct {
kind TokenKind
start int
str_id strpool.StringId = strpool.NoId
str_id strpool.StringId = strpool.NO_ID
}
TokenKind :: enum {
# keywords
if, else
for, while
proc, return
# literals
ident, string
int, float
# comparison
equal_equal, not_equal
less, less_equal
greater, greater_equal
# assignment
equal, double_colon
# delimiters
open_paren, close_paren
open_bracket, close_bracket
open_curly, close_curly
colon
newline
# special
eof
invalid
}