referencing and methods
This commit is contained in:
6
lexer.v
6
lexer.v
@@ -16,6 +16,8 @@ enum TokenType as u8 {
|
||||
kw_return
|
||||
kw_print
|
||||
kw_class
|
||||
kw_ref
|
||||
kw_deref
|
||||
integer
|
||||
real
|
||||
boolean
|
||||
@@ -126,6 +128,8 @@ fn toktype_from_kw(kw string) TokenType {
|
||||
'print' {.kw_print}
|
||||
'class' {.kw_class}
|
||||
'immutable' {.kw_immutable}
|
||||
'ref' {.kw_ref}
|
||||
'deref' {.kw_deref}
|
||||
else {.unknown}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +149,7 @@ fn is_real(str string) bool {
|
||||
|
||||
fn is_keyword(str string) bool {
|
||||
return [
|
||||
"void", "int", "real", "bool", "string", "if", "else", "elif", "while", "break", "fn", "return", "let", "const", "true", "false", "print", "class", "immutable"
|
||||
"void", "int", "real", "bool", "string", "if", "else", "elif", "while", "break", "fn", "return", "let", "const", "true", "false", "print", "class", "immutable", "ref", "deref"
|
||||
].contains(str)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user