This commit is contained in:
2025-02-10 13:43:38 -05:00
parent 03ae07485b
commit 42b87be084
3 changed files with 15 additions and 3 deletions
+3 -2
View File
@@ -583,8 +583,9 @@ sll__queue_push_nz(
inline void
sll__queue_push_front_nz(void* nil, void** f, void** l, void* n, void** n_next) {
if (check_nil(nil, *f)) {
*f = n;
*l = n;
*f = n;
*l = n;
*n_next = nil;
}
else {
*n_next = f;
+1 -1
View File
@@ -695,7 +695,7 @@ str8_list_push_frontf__arena(Arena *arena, String8List *list, char *fmt, ...) {
inline String8Node*
str8_list_push__ainfo(AllocatorInfo ainfo, String8List* list, String8 string) {
String8Node* node = alloc_array_no_zero(ainfo, String8Node, 1);
str8_list_push_node_front_set_string(list, node, string);
str8_list_push_node_set_string(list, node, string);
return(node);
}
+11
View File
@@ -25,5 +25,16 @@ int main()
TokenizeResult lexed = tokenize_from_text (arena, hello_world_mdesk);
ParseResult parsed = parse_from_text_tokens(arena, text(path_hello_world_mdesk), hello_world_mdesk, lexed.tokens);
#define str8_list_iter(list, elem) list.first; elem; elem = elem->next
String8List debug_list = debug_string_list_from_tree(arena, parsed.root);
printf("Parsed listing:\n");
// for (String8Node* elem = str8_list_iter(debug_list, elem))
for (String8Node* elem = debug_list.first; elem; elem = elem->next)
{
String8 entry = elem->string;
printf("\tentry: %*s\n", (int)entry.size, entry.str);
}
deinit(& ctx);
}