mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-25 07:04: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
|
||||
processing_state.depth = processing_state.depth - 1
|
||||
|
||||
--remove circular
|
||||
circular_references[input] = nil
|
||||
|
||||
local multiline = #chunks > 1
|
||||
local separator = (indent == "" or not multiline) and ", " or ",\n"..indent
|
||||
|
||||
@ -173,4 +176,4 @@ function pretty._process(input, config, processing_state)
|
||||
return "{" .. prelude .. table.concat(chunks, separator) .. "}"
|
||||
end
|
||||
|
||||
return pretty
|
||||
return pretty
|
||||
|
Loading…
Reference in New Issue
Block a user