JSON: Difference between revisions

Content added Content deleted
No edit summary
(→‎{{header|Tailspin}}: Update to stricter typing)
Line 4,184: Line 4,184:
when <{}> do
when <{}> do
[ $... ] -> '{$(1) -> printKeyValue;$(2..last)... -> ', $ -> printKeyValue;';}' !
[ $... ] -> '{$(1) -> printKeyValue;$(2..last)... -> ', $ -> printKeyValue;';}' !
when <..0|0..> do
when <..> do
'$;'!
'$;'!
when <'.*'> do
when <''> do
[ $... -> encodeChars ] -> '"$...;"' !
[ $... -> encodeChars ] -> '"$...;"' !
otherwise 'WTF!' !
otherwise 'WTF!' !
Line 4,196: Line 4,196:


{ blue: [1,2], ocean: 'water' } -> printJson -> '$;
{ blue: [1,2], ocean: 'water' } -> printJson -> '$;
' -> !OUT::write

'plain string
' -> printJson -> '$;
' -> !OUT::write
' -> !OUT::write
</lang>
</lang>
Line 4,202: Line 4,206:
apples
apples
{"blue": [1, 2], "ocean": "water"}
{"blue": [1, 2], "ocean": "water"}
"plain string\n"
</pre>
</pre>