JSON: Difference between revisions

41 bytes added ,  3 years ago
m
m (→‎{{header|Tailspin}}: syntax update)
Line 4,029:
end encodeChars
$ -> #
when <[]> do
'[$(1) -> printJson;$(2..last)... -> ', $ -> printJson;';]' !
when <{}> do
[ $... ] -> '{$(1) -> printKeyValue;$(2..-1last)... -> ', $ -> printKeyValue;';}' !
when <..0|0..> do
'$;'!
when <'.*'> do
[ $... -> encodeChars ] -> '"$...;"' !
<>otherwise 'WTF!' !
// Other types do not yet exist in Tailspin
end printJson
Anonymous user