Arrays without code generation (#6)

Co-authored-by: Abdelrahman Said <said.abdelrahman@flawlessai.com>
Reviewed-on: #6
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit is contained in:
2025-12-14 01:47:43 +00:00
committed by Abdelrahman Said
parent 331f7e5e4e
commit de9ce5791a
40 changed files with 581 additions and 4796 deletions

View File

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