Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,28 @@
scope # JSON encode/decode - translation of the Phix sample, using Agena's standard json module
import json;
print( "roundtrip (10 examples):" );
local constant json_strings := [ '{"this":"that","age":{"this":"that","age":29}}'
, '1'
, '"hello"'
, 'null'
, '[12]'
, '[null,12]'
, '[]'
, '{"this":"that","age":29}'
, '{}'
, '[null,[null,12]]'
];
for i to size json_strings do
local constant s := json_strings[ i ];
local constant j := json.decode( s );
local constant r := json.encode( j );
local constant pad := if size s < 29 then 30 else size s + 1 fi;
print( " " & strings.ljustify( s, pad ) & " -> "
, j, "\n" & if s = r then "-> " else "** " fi & r & "\n"
)
od
end