about summary refs log tree commit diff
path: root/src/main.zig
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-01-13 00:33:56 +0100
committerBaitinq <[email protected]>2025-01-13 00:33:56 +0100
commitde594ada98e053d3c2bdd4e17ad8b6e2aa6505a2 (patch)
treea4370e8881b0a8af0c46def028cae0fa73237427 /src/main.zig
parentImplement "return" (diff)
downloadinterpreter-de594ada98e053d3c2bdd4e17ad8b6e2aa6505a2.tar.gz
interpreter-de594ada98e053d3c2bdd4e17ad8b6e2aa6505a2.tar.bz2
interpreter-de594ada98e053d3c2bdd4e17ad8b6e2aa6505a2.zip
Tokenizer: Add support for tokenizing functions
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig
index bc88aeb..e7ebba3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -51,11 +51,8 @@ fn process_buf(buf: []u8, allocator: std.mem.Allocator, arena: *std.heap.ArenaAl
 
     var source_tokenizer = try tokenizer.Tokenizer.init(buf);
     while (try source_tokenizer.next()) |token| {
-        try token_list.append(token);
-    }
-
-    for (token_list.items) |token| {
         std.debug.print("{any}\n", .{token});
+        try token_list.append(token);
     }
 
     const source_parser = try parser.Parser.init(token_list.items, arena.allocator());