// Represents a code block. Not constructable outside of using a '#code' directive.
-Code :: struct {}
\ No newline at end of file
+Code :: struct {_:i32;}
\ No newline at end of file
if (node == NULL) return NULL;
if (!should_clone(node)) return node;
+ static int clone_depth = 0;
+ clone_depth++;
+
i32 node_size = ast_kind_to_size(node);
// bh_printf("Cloning %s with size %d\n", onyx_ast_node_kind_string(node->kind), node_size);
break;
case Ast_Kind_Function: {
+ if (clone_depth > 1) {
+ clone_depth--;
+ return node;
+ }
+
AstFunction* df = (AstFunction *) nn;
AstFunction* sf = (AstFunction *) node;
}
}
+ clone_depth--;
return nn;
}