diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-04-13 15:51:39 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-04-13 15:51:39 +0200 |
commit | 25fcad7435f56cdce2658336909f4da6a65589c0 (patch) | |
tree | c23d5d04a7e86c7ddc2ebeca06d3de63ebdc806e /tex/context/base/mkiv/node-nut.lua | |
parent | 1e5d7f41ddede5e6400a2a7762032823d3545df4 (diff) | |
download | context-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.lua | 30 |
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 |