Mark it as complete
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user