mutable decl syntax change

This commit is contained in:
2026-08-05 21:19:41 +02:00
parent 88b94197c9
commit 081a3fd5df
74 changed files with 870 additions and 733 deletions
+3 -3
View File
@@ -48,7 +48,7 @@ hide append_token func(tokens @mut std.ArrayList(Token), kind Kind, start, end u
}
lex func(source []u8, tokens @mut std.ArrayList(Token)) void ! mem.AllocError {
cursor usize = 0
cursor usize := 0
while cursor < source.len {
value u8 :: source[cursor]
if value == ' ' or value == '\t' or value == '\r' {
@@ -112,7 +112,7 @@ hide print_token func(source []u8, token Token) void {
_ = c.printf("%-11s", kind_name(token.kind))
if token.length != 0 {
_ = c.printf(" `")
i usize = 0
i usize := 0
while i < token.length : i += 1 {
value u8 :: source[token.start + i]
if value == '\n' {
@@ -132,7 +132,7 @@ main func() i32 {
` hello()
`}
tokens std.ArrayList(Token) = arraylist.init(mem.c_allocator)
tokens std.ArrayList(Token) := arraylist.init(mem.c_allocator)
defer arraylist.deinit(&tokens)
lex(source, &tokens) catch |_| {