Mark it as complete

This commit is contained in:
Krzosa Karol
2023-02-11 11:12:10 +01:00
parent 391df593a2
commit 90c96f1495
2 changed files with 14 additions and 31 deletions

View File

@@ -430,33 +430,6 @@ GetTypeInfo :: (type: Type): *Type_Info
}
typedef void Ast_Visit_Callback(Ast *ast);
// @todo: We are traversing the modules multiple times cause they can have multiple connections, need to add visit id
void ast_list_rewrite_callback(Ast *ast) {
switch(ast->kind) {
CASE(CALL, Call) {
if (node->name->kind == AST_IDENT) {
Ast_Atom *ident = (Ast_Atom *)node->name;
if (pctx->intern("List_Insert"_s) == ident->intern_val) {
Ast_Decl *list_insert = search_for_single_decl(pctx->custom_module, pctx->intern("List_Insert"_s), false);
if (!list_insert) {
custom_parse_string(R"(
List_Insert :: (list: List, node: Node)
if list.first == 0
list.first = node
list.last = node
else
list.last.next = node
list.last = node
)"_s);
list_insert = search_for_single_decl(pctx->custom_module, pctx->intern("List_Insert"_s), false);
}
assert(list_insert);
}
}
BREAK();
}
}
}
void ast_visit(uint32_t visit_id, Ast_Visit_Callback *callback, Ast *ast) {
if (!ast) return;