Add string methods to json, and fix issue in dstring when the formatter uses temp. Remove unnecessary use of temp allocator in to_format for json.

This commit is contained in:
Christoffer Lerno
2024-08-10 19:13:58 +02:00
parent 05421223be
commit 811cb2b95c
4 changed files with 62 additions and 12 deletions

View File

@@ -48,9 +48,9 @@ fn usz! Object.to_format(&self, Formatter* formatter) @dynamic
return n;
case ObjectInternalMap:
usz n = formatter.printf("{")!;
@pool()
@stack_mem(1024; Allocator mem)
{
foreach (i, key : self.map.key_tlist())
foreach (i, key : self.map.key_new_list(mem))
{
if (i > 0) n += formatter.printf(",")!;
n += formatter.printf(`"%s":`, key)!;