- Introduce $vaarg[...] syntax and deprecate the old $vaarg(...).

- Similar change to `$vasplat`: `$vasplat` and `$vasplat[1..]`.
This commit is contained in:
Christoffer Lerno
2024-08-16 09:28:28 +02:00
parent 9fd9280132
commit edfea639cf
20 changed files with 119 additions and 74 deletions

View File

@@ -40,7 +40,7 @@ fault NumberConversion
macro String tformat(String fmt, ...)
{
DString str = dstring::temp_with_capacity(fmt.len + $vacount * 8);
str.appendf(fmt, $vasplat());
str.appendf(fmt, $vasplat);
return str.str_view();
}
@@ -52,7 +52,7 @@ macro String tformat(String fmt, ...)
macro ZString tformat_zstr(String fmt, ...)
{
DString str = dstring::temp_with_capacity(fmt.len + $vacount * 8);
str.appendf(fmt, $vasplat());
str.appendf(fmt, $vasplat);
return str.zstr_view();
}
@@ -67,7 +67,7 @@ macro String new_format(String fmt, ..., Allocator allocator = allocator::heap()
@pool(allocator)
{
DString str = dstring::temp_with_capacity(fmt.len + $vacount * 8);
str.appendf(fmt, $vasplat());
str.appendf(fmt, $vasplat);
return str.copy_str(allocator);
};
}
@@ -83,7 +83,7 @@ macro ZString new_format_zstr(String fmt, ..., Allocator allocator = allocator::
@pool(allocator)
{
DString str = dstring::temp_with_capacity(fmt.len + $vacount * 8);
str.appendf(fmt, $vasplat());
str.appendf(fmt, $vasplat);
return str.copy_zstr(allocator);
};
}