while loops

This commit is contained in:
2026-06-21 23:26:11 +02:00
parent f4194492cc
commit 380b5943b3
12 changed files with 548 additions and 16 deletions
+2 -2
View File
@@ -26,6 +26,7 @@ keyword_kind :: proc(text: string) -> token.Kind {
case "and": return .Keyword_And
case "or": return .Keyword_Or
case "if": return .Keyword_If
case "while": return .Keyword_While
case "else": return .Keyword_Else
case "true": return .Keyword_True
case "false": return .Keyword_False
@@ -109,8 +110,7 @@ lex :: proc(
cursor += 1
append_token(&stream, source_file, .Colon_Colon, start, cursor)
} else {
id := source.add(diagnostics, source.Span{file=source_file.id, start=source.Offset(start), end=source.Offset(cursor)}, "expected a second ':'")
append_token(&stream, source_file, .Invalid, start, cursor, diagnostic=id)
append_token(&stream, source_file, .Colon, start, cursor)
}
case '=':
start := cursor