diff options
Diffstat (limited to 'tex/context/base/mkiv/util-tab.lua')
-rw-r--r-- | tex/context/base/mkiv/util-tab.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua index a92b47b3f..7f372b6b5 100644 --- a/tex/context/base/mkiv/util-tab.lua +++ b/tex/context/base/mkiv/util-tab.lua @@ -978,3 +978,21 @@ end -- return remove(t,random(1,n)) -- end -- end + +function combine(target,source) + -- no copy so if that is needed one needs to deepcopy source first + if target then + for k, v in next, source do + if type(v) == "table" then + target[k] = combine(target[k],source[k]) + else + target[k] = v + end + end + return target + else + return source + end +end + +table.combine = combine |