mirror of
https://github.com/pkulchenko/serpent.git
synced 2024-11-21 23:24:24 +00:00
ecf3b48c83
`insref` argument of `val2str` explicitly sets name to use for a value within the self reference section when it is seen again. It's necessary to provide it for table keys, as they can only be referenced through the `iname` storage table. For values sref name can be calculated based on sref of the parent table and the key. When serializing normal values (key is not a table or another special type), `insref` was passed as is to the recursive `val2str` call. This is incorrect when `insref` is actually present (i.e. parent table is a table key or a value for a table key), the values should get their own sref names instead of the parent name. Passing `nil` instead is enough to fix this. Fixes #28, closes #30. |
||
---|---|---|
.. | ||
bench.lua | ||
test.lua |