while loops
This commit is contained in:
6
lexer.v
6
lexer.v
@@ -10,7 +10,7 @@ enum TokenType as u8 {
|
||||
kw_if
|
||||
kw_else
|
||||
kw_elif
|
||||
kw_for
|
||||
kw_while
|
||||
kw_break
|
||||
kw_fn
|
||||
kw_return
|
||||
@@ -106,7 +106,7 @@ fn toktype_from_kw(kw string) TokenType {
|
||||
'if' {.kw_if}
|
||||
'else' {.kw_else}
|
||||
'elif' {.kw_elif}
|
||||
'for' {.kw_for}
|
||||
'while' {.kw_while}
|
||||
'break' {.kw_break}
|
||||
'fn' {.kw_fn}
|
||||
'return' {.kw_return}
|
||||
@@ -133,7 +133,7 @@ fn is_real(str string) bool {
|
||||
|
||||
fn is_keyword(str string) bool {
|
||||
return [
|
||||
"void", "int", "real", "bool", "string", "if", "else", "elif", "for", "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"
|
||||
].contains(str)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user