#match format (output: ^Format_Output, format: str, va: ..any) -> str {
return format_va(output, format, ~~va);
}
+#match format (buffer: ^[..] u8, format: str, va: ..any) {
+ buffer.count = buffer.capacity;
+ out := format_va(*buffer, format, ~~va);
+ buffer.count = out.count;
+}
format_va :: #match {}
#match format_va (buffer: [] u8, format: str, va: [] any) -> str {
output := Format_Output.{ buffer.data, 0, buffer.count };
return format_va(^output, format, va);
}
+#match format_va (buffer: ^[..] u8, format: str, va: [] any) {
+ buffer.count = buffer.capacity;
+ out := format_va(*buffer, format, va);
+ buffer.count = out.count;
+}
#match format_va (output: ^Format_Output, format: str, va: [] any) -> str {
vararg_index := 0;
case Ast_Kind_Struct_Type: {
AstStructType* st = (AstStructType *) tag->expr;
- if (st->meta_tags == NULL) bh_arr_new(global_heap_allocator, st->meta_tags, 1);
- bh_arr_push(st->meta_tags, tag->tag);
+ bh_arr(AstTyped *) tags = st->meta_tags;
+
+ if (tags == NULL) bh_arr_new(global_heap_allocator, tags, 1);
+ bh_arr_push(tags, tag->tag);
+
+ st->meta_tags = tags;
return Check_Complete;
}