aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/serialization.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/serialization.lua b/util/serialization.lua
index 64497382..401bf6f8 100644
--- a/util/serialization.lua
+++ b/util/serialization.lua
@@ -119,6 +119,7 @@ local function new(opt)
local unquoted = opt.unquoted == nil and "^[%a_][%w_]*$" or opt.unquoted;
local hex = opt.hex;
local freeze = opt.freeze;
+ local maxdepth = opt.maxdepth or 127;
-- serialize one table, recursively
-- t - table being serialized
@@ -127,7 +128,7 @@ local function new(opt)
-- 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 > 127 then
+ if o[t] or d > maxdepth then
o[l], l = fallback(t, "recursion"), l + 1;
return l;
end