September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
25
Task/JSON/Phix/json.phix
Normal file
25
Task/JSON/Phix/json.phix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
--
|
||||
-- demo\rosetta\JSON.exw
|
||||
-- =====================
|
||||
--
|
||||
include builtins/json.e
|
||||
|
||||
puts(1,"roundtrip (10 examples):\n")
|
||||
sequence json_strings = {"{\"this\":\"that\",\"age\":{\"this\":\"that\",\"age\":29}}",
|
||||
"1",
|
||||
"\"hello\"",
|
||||
"null",
|
||||
"[12]",
|
||||
"[null,12]",
|
||||
"[]",
|
||||
"{\"this\":\"that\",\"age\":29}",
|
||||
"{}",
|
||||
"[null,[null,12]]"}
|
||||
|
||||
for i=1 to length(json_strings) do
|
||||
string s = json_strings[i]
|
||||
puts(1,s&"\n")
|
||||
object json_object = parse_json(s)
|
||||
puts(1,print_json("",json_object,true)&"\n")
|
||||
if not equal(print_json("",json_object,true),s) then ?9/0 end if
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue