struct -> class
This commit is contained in:
6
lexer.v
6
lexer.v
@@ -13,7 +13,7 @@ enum TokenType as u8 {
|
||||
kw_fn
|
||||
kw_return
|
||||
kw_print
|
||||
kw_struct
|
||||
kw_class
|
||||
integer
|
||||
real
|
||||
boolean
|
||||
@@ -104,7 +104,7 @@ fn toktype_from_kw(kw string) TokenType {
|
||||
'return' {.kw_return}
|
||||
'true', 'false' {.boolean}
|
||||
'print' {.kw_print}
|
||||
'struct' {.kw_struct}
|
||||
'class' {.kw_class}
|
||||
else {.unknown}
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ fn is_real(str string) bool {
|
||||
|
||||
fn is_keyword(str string) bool {
|
||||
return [
|
||||
"void", "int", "real", "bool", "if", "else", "for", "break", "fn", "return", "let", "const", "true", "false", "print", "struct"
|
||||
"void", "int", "real", "bool", "if", "else", "for", "break", "fn", "return", "let", "const", "true", "false", "print", "class"
|
||||
].contains(str)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user