diff options
Diffstat (limited to 'tex/context/base/mkiv/node-met.lua')
-rw-r--r-- | tex/context/base/mkiv/node-met.lua | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua index 12a9256bc..4141c8b66 100644 --- a/tex/context/base/mkiv/node-met.lua +++ b/tex/context/base/mkiv/node-met.lua @@ -62,6 +62,26 @@ end -- statistics.tracefunction(node, "node", "getfield","setfield") -- statistics.tracefunction(node.direct,"node.direct","getfield","setfield") +if LUATEXFUNCTIONALITY < 6695 then + + local getnext = node.getnext + local getid = node.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 node.traverse(h) + return iterate, h + end + +end + -- We start with some helpers and provide all relevant basic functions in the -- node namespace as well. @@ -163,7 +183,7 @@ local n_setlink = node.setlink or -- always -- not that fast but not used often anyway local h = nil for i=1,select("#",...) do - local n = (select(i,...)) + local n = select(i,...) if not n then -- go on elseif h then |