summaryrefslogtreecommitdiffstats
path: root/strudel.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-31 20:18:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-31 20:18:12 -0700
commit59beb217e76f3518ad35ea1d51b36452cf5723fd (patch)
tree3c3131edd6e6a0d3e363bd69f2564df90ccfcb1f /strudel.c
parentfdb8f90b22f8d4993b5937d55f5cbffc45ae940c (diff)
downloadtxr-59beb217e76f3518ad35ea1d51b36452cf5723fd.tar.gz
txr-59beb217e76f3518ad35ea1d51b36452cf5723fd.tar.bz2
txr-59beb217e76f3518ad35ea1d51b36452cf5723fd.zip
json: fix circular printing.
The recursive JSON printer must check for the circularity circularity-related conditions and emit #n= and #n# notations. * lib.c (circle_print_eligible): Function moved before out_json_rec to avoid a forward declaration. (check_emit_circle): New static function. This is a block of code for doing the circular logic, taken out of obj_print_impl, because we would like to use it in out_json_rec. (out_json_rec): Call check_emit_circle to emit any #n= or #n# notation. The function returns 1 if it has emitted #n#, in which a se we are done. (obj_print_impl): Replace moved block of code with call to check_emit_circle.
Diffstat (limited to 'strudel.c')
0 files changed, 0 insertions, 0 deletions