diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-07-24 12:35:49 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-07-24 12:35:49 +0200 |
commit | 352517495e32813d30d0080f2a0c8dd1afea794a (patch) | |
tree | 346f33901602d6bd6db1c5913ff092fcf821fa10 /tex/context/base/mkiv/util-tab.lua | |
parent | 82c674fdcf5bcff4ad0dc0936d638fc729145616 (diff) | |
download | context-352517495e32813d30d0080f2a0c8dd1afea794a.tar.gz |
2022-07-24 12:18:00
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 |