parse const decls
This commit is contained in:
+32
-28
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user