summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-nut.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-04-13 15:51:39 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-04-13 15:51:39 +0200
commit25fcad7435f56cdce2658336909f4da6a65589c0 (patch)
treec23d5d04a7e86c7ddc2ebeca06d3de63ebdc806e /tex/context/base/mkiv/node-nut.lua
parent1e5d7f41ddede5e6400a2a7762032823d3545df4 (diff)
downloadcontext-25fcad7435f56cdce2658336909f4da6a65589c0.tar.gz
2018-04-13 15:02:00
Diffstat (limited to 'tex/context/base/mkiv/node-nut.lua')
-rw-r--r--tex/context/base/mkiv/node-nut.lua30
1 files changed, 20 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index 3e9a08b48..302ece4bf 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -143,16 +143,6 @@ nodes.tonut = tonut
-- helpers
-if not direct.getfam then -- LUATEXVERSION < 1.070
-
- local getfield = direct.getfield
- local setfield = direct.setfield
-
- direct.getfam = function(n) return getfield(n,"small_fam") end
- direct.setfam = function(n,f) setfield(n,"small_fam",f) end
-
-end
-
if not direct.getdirection then
local getdir = direct.getdir
@@ -184,6 +174,26 @@ if not direct.getdirection then
end
+if LUATEXFUNCTIONALITY < 6695 then
+
+ local getnext = direct.getnext
+ local getid = direct.getid
+
+ local function iterate(h,n)
+ if n then
+ local n = getnext(n)
+ return n, getid(n)
+ elseif h then
+ return h, getid(h), getnext(h)
+ end
+ end
+
+ function direct.traverse(h)
+ return iterate, h
+ end
+
+end
+
local nuts = nodes.nuts
nuts.tostring = direct.tostring