arr.count = 0;
arr.capacity = 0;
- raw_free(arr.allocator, arr.data);
+ if arr.data != null do raw_free(arr.allocator, arr.data);
arr.data = null;
}
print(conv.str_format_va(buffer, format, va));
}
+aprintf :: (format: str, va: ..any) -> str {
+ buffer: [8196] u8;
+ out := conv.str_format_va(buffer, format, va);
+ return string.alloc_copy(out);
+}
+
// This works on both slices and arrays
print_array :: #match {
(arr: [$N] $T, sep := " ") {
- match: '([a-zA-Z_][a-zA-Z0-9_\.]+)\s*\('
captures:
- 1: meta.function-call.onyx
+ 1: variable.function.onyx
# - match: '([a-zA-Z_][a-zA-Z0-9_]*)(,\s*([a-zA-Z_][a-zA-Z0-9_]*))*\s*:'
# captures:
if (struct_scope == NULL) goto no_methods;
fori (i, 0, shlen(struct_scope->symbols)) {
- AstFunction* node = (AstFunction *) struct_scope->symbols[i].value;
+ AstFunction* node = (AstFunction *) strip_aliases(struct_scope->symbols[i].value);
if (node->kind != Ast_Kind_Function) continue;
assert(node->entity);
assert(node->entity->function == node);
Hello, I am Billy!
-Go away!! func[16]
+Go away!! func[51]