mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-25 15:14:35 +00:00
pretty format: circular reference ids only apply in their own reference tree
so, repeated but not circular data is repeatedly output helpful for serialisation-like uses and more clear because the id was not printed on the actual data structure in this case
This commit is contained in:
parent
ad8012c89b
commit
2b6a6d8f53
@ -161,6 +161,9 @@ function pretty._process(input, config, processing_state)
|
|||||||
--drop depth
|
--drop depth
|
||||||
processing_state.depth = processing_state.depth - 1
|
processing_state.depth = processing_state.depth - 1
|
||||||
|
|
||||||
|
--remove circular
|
||||||
|
circular_references[input] = nil
|
||||||
|
|
||||||
local multiline = #chunks > 1
|
local multiline = #chunks > 1
|
||||||
local separator = (indent == "" or not multiline) and ", " or ",\n"..indent
|
local separator = (indent == "" or not multiline) and ", " or ",\n"..indent
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user