summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-nut.lua
diff options
context:
space:
mode:
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