Add code generation for doubly linked list

This commit is contained in:
2025-03-02 13:20:27 +00:00
parent 509724cc31
commit e7d2553400
22 changed files with 664 additions and 229 deletions

View File

@@ -0,0 +1,15 @@
{T}List output = {{.first = node, .last = node, .total_size = node->string->size, .node_count = 1}};
while (output.first->prev != NULL) {{
output.total_size += output.first->prev->string->size;
output.first = output.first->prev;
++(output.node_count);
}}
while (output.last->next != NULL) {{
output.total_size += output.last->next->string->size;
output.last = output.last->next;
++(output.node_count);
}}
return output;