diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-28 07:11:53 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-28 07:11:53 -0700 |
commit | d13518bba592ebfa2cb471aaa47ae50d11606ff9 (patch) | |
tree | b0c8908ba5a1eb4d1c36813b4bc78efda145a78e /txr.1 | |
parent | ec03421d25dd3296cfcfc39133f051a8ebe094a3 (diff) | |
download | txr-d13518bba592ebfa2cb471aaa47ae50d11606ff9.tar.gz txr-d13518bba592ebfa2cb471aaa47ae50d11606ff9.tar.bz2 txr-d13518bba592ebfa2cb471aaa47ae50d11606ff9.zip |
json: printing support.
First cut, without line breaks or indentation.
* lib.c (out_json_str, out_json_rec, out_json): New static
functions.
(obj_print_impl): Hook in json printing via out_json.
* txr.1: Add notes about output to JSON extensions.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -12431,6 +12431,18 @@ The JSON escape sequence .code "\eu0000" denoting the U+0000 NUL character is also converted to U+DC00. +When a JSON string is output, any code points U+DC01 through U+DCFF occurring +in that string are assumed to denote raw bytes to be output, without +escaping. The code point U+DC00 produces the +.code "\eu0000" +escape syntax. This behavior is different from \*(TL literals, which, on +output, simply render these code points using +.code "\ex" +escape sequences. Rationale: this is because JSON is considered an external format. +The requirements are intended to reproduce the original byte sequence, if +possible, rather than JSON syntax which will produce the same \*(TX object +if read back by \*(TX. + \*(TL does not impose the restriction that the keys in a JSON object must be strings: .code "#J{1:2,true:false}" |