summaryrefslogtreecommitdiff
path: root/exercises/103_tokenization.zig
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2025-12-15 15:04:38 +0100
committerChris Boesch <chrboesch@noreply.codeberg.org>2025-12-15 15:04:38 +0100
commitbb4e984a8e944c6937a47a293940b958fc93c925 (patch)
tree4c4a7c020cbf67a727db6f6c04a83aebbf8fba48 /exercises/103_tokenization.zig
parent2ffc3ee1d806c24b82a037f1a24ecb392c580a1c (diff)
parent82d5dda2736d2b6c7d93c4bc2b14a4a9d5b4a5eb (diff)
Merge pull request 'Update zig homepage example in 103' (#336) from nkhl/exercises:103-update-homepage-example into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/336
Diffstat (limited to 'exercises/103_tokenization.zig')
-rw-r--r--exercises/103_tokenization.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/exercises/103_tokenization.zig b/exercises/103_tokenization.zig
index 6f71177..972e8e8 100644
--- a/exercises/103_tokenization.zig
+++ b/exercises/103_tokenization.zig
@@ -48,15 +48,14 @@
// // In order to be able to process the input values,
// // memory is required. An allocator is defined here for
// // this purpose.
-// const ally = std.testing.allocator;
+// const gpa = std.testing.allocator;
//
-// // The allocator is used to initialize an array into which
-// // the numbers are stored.
-// var list = std.ArrayList(u32).init(ally);
+// // An array into which the numbers are stored is initialized.
+// var list: std.ArrayList(u32) = .empty;
//
// // This way you can never forget what is urgently needed
// // and the compiler doesn't grumble either.
-// defer list.deinit();
+// defer list.deinit(gpa);
//
// // Now it gets exciting:
// // A standard tokenizer is called (Zig has several) and
@@ -73,7 +72,7 @@
// const n = try parseInt(u32, num, 10);
//
// // Finally the individual values are stored in the array.
-// try list.append(n);
+// try list.append(gpa, n);
// }
//
// // For the subsequent test, a second static array is created,