streamline scan(-)

This commit is contained in:
2026-07-13 23:52:09 +02:00
parent 6f61be436a
commit 6d024e6a0c
+3
View File
@@ -73,6 +73,7 @@ scan func(tokens @mut std.ArrayList(Token), input []u8) void ! mem.AllocError {
if char == '\n' { if char == '\n' {
try arraylist.append(tokens, Token{ kind = .newline, start = cursor }) try arraylist.append(tokens, Token{ kind = .newline, start = cursor })
cursor += 1 cursor += 1
continue
} else if _is_whitespace(char) { } else if _is_whitespace(char) {
cursor += 1 cursor += 1
continue continue
@@ -81,6 +82,8 @@ scan func(tokens @mut std.ArrayList(Token), input []u8) void ! mem.AllocError {
# comments # comments
if char == '#' { if char == '#' {
while cursor < input.len and input[cursor] != '\n' : cursor += 1 {} while cursor < input.len and input[cursor] != '\n' : cursor += 1 {}
cursor += 1
continue
} }
# identifiers and keywords # identifiers and keywords