"@ensure" now correctly only runs on non-optional results. Subtypes now merge to a single type. Beginning deprecation of "std::core::str". Refreshed String functions. Consistent use of ".using" parameter. Functions moved to string methods. Tests on more string methods. Fixes to split, rindex_of.

This commit is contained in:
Christoffer Lerno
2023-03-07 19:32:47 +01:00
committed by Christoffer Lerno
parent 33cc2d889b
commit 89de0a70d2
27 changed files with 410 additions and 245 deletions

View File

@@ -9,7 +9,7 @@ typedef Text = VarString;
const usz MIN_CAPACITY = 16;
fn VarString new_with_capacity(usz capacity, Allocator* allocator = mem::heap())
fn VarString new_with_capacity(usz capacity, Allocator* allocator = mem::heap()) @deprecated
{
if (capacity < MIN_CAPACITY) capacity = MIN_CAPACITY;
StringData* data = malloc(StringData, 1, .using = allocator, .end_padding = capacity);
@@ -19,7 +19,7 @@ fn VarString new_with_capacity(usz capacity, Allocator* allocator = mem::heap())
return (VarString)data;
}
fn VarString new(String c)
fn VarString new(String c) @deprecated
{
usz len = c.len;
VarString str = new_with_capacity(len);