--- a/util/serialization.lua Sat Oct 27 12:17:35 2018 +0200
+++ b/util/serialization.lua Sat Oct 27 12:38:47 2018 +0200
@@ -128,8 +128,11 @@
-- l - position in o of where to insert next token
-- d - depth, used for indentation
local function serialize_table(t, o, l, d)
- if o[t] or d > maxdepth then
- o[l], l = fallback(t, "recursion"), l + 1;
+ if o[t] then
+ o[l], l = fallback(t, "table has multiple references"), l + 1;
+ return l;
+ elseif d > maxdepth then
+ o[l], l = fallback(t, "max table depth reached"), l + 1;
return l;
end