Restore array structs but with no codegen (#7)

Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
2025-12-14 23:48:13 +00:00
parent 056dbbf3d7
commit efadbf5fc2
12 changed files with 379 additions and 434 deletions

View File

@@ -6,15 +6,15 @@ TestFuncResult test_str8_array(void) {
b8 result;
Str8 expected[] = {wapp_str8_lit("Hello"), wapp_str8_lit("Hi"), wapp_str8_lit("Bye")};
Str8 *array = wapp_array(Str8, wapp_str8_lit("Hello"), wapp_str8_lit("Hi"), wapp_str8_lit("Bye"));
result = wapp_array_count(array) == 3 && wapp_array_capacity(array) == 8;
Str8Array array = wapp_array(Str8, Str8Array, wapp_str8_lit("Hello"), wapp_str8_lit("Hi"), wapp_str8_lit("Bye"));
result = array.count == 3 && array.capacity == 8;
Str8 *item;
u64 count = wapp_array_count(array);
u64 count = array.count;
u64 index = 0;
b8 running = true;
while (running) {
item = wapp_array_get(Str8, array, index);
item = wapp_array_get(Str8, &array, index);
result = result && item && (wapp_str8_equal(item, &expected[index]));
++index;