diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-09-02 00:04:51 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-09-02 00:04:51 +0200 |
commit | fd9c4ecd4421d087de21bef1e53d8ffb016285b0 (patch) | |
tree | 64606204adcabe2f197984ca8d063891b770bace /tex/context/base/mkiv/node-met.lua | |
parent | 2106beefbc854f77a92264c815d3cf2b3460f0b6 (diff) | |
download | context-fd9c4ecd4421d087de21bef1e53d8ffb016285b0.tar.gz |
2018-09-01 23:20:00
Diffstat (limited to 'tex/context/base/mkiv/node-met.lua')
-rw-r--r-- | tex/context/base/mkiv/node-met.lua | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua index 3116cf2fb..5c6a24c65 100644 --- a/tex/context/base/mkiv/node-met.lua +++ b/tex/context/base/mkiv/node-met.lua @@ -62,26 +62,6 @@ 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. @@ -645,7 +625,7 @@ local messyhack = table.tohash { -- temporary solution nodecodes.action, } -table.setmetatableindex(keys,function(t,k) +setmetatableindex(keys,function(t,k) local v = (k == "attributelist" or k == nodecodes.attributelist) and { } or getfields(k) if messyhack[k] then for i=1,#v do @@ -662,7 +642,7 @@ table.setmetatableindex(keys,function(t,k) return v end) -table.setmetatableindex(whatsitkeys,function(t,k) +setmetatableindex(whatsitkeys,function(t,k) local v = getfields(whatsit_code,k) if v[ 0] then v[#v+1] = "next" v[ 0] = nil end if v[-1] then v[#v+1] = "prev" v[-1] = nil end @@ -683,45 +663,3 @@ end nodes.keys = keys -- [id][subtype] nodes.fields = nodefields -- (n) - --- for the moment (pre 6380) - -if not nodes.unprotect_glyph then - - local protect_glyph = nodes.protect_glyph - local protect_glyphs = nodes.protect_glyphs - local unprotect_glyph = nodes.unprotect_glyph - local unprotect_glyphs = nodes.unprotect_glyphs - - local getnext = nodes.getnext - local setnext = nodes.setnext - - function nodes.protectglyphs(first,last) - if first == last then - return protect_glyph(first) - elseif last then - local nxt = getnext(last) - setnext(last) - local f, b = protect_glyphs(first) - setnext(last,nxt) - return f, b - else - return protect_glyphs(first) - end - end - - function nodes.unprotectglyphs(first,last) - if first == last then - return unprotect_glyph(first) - elseif last then - local nxt = getnext(last) - setnext(last) - local f, b = unprotect_glyphs(first) - setnext(last,nxt) - return f, b - else - return unprotect_glyphs(first) - end - end - -end |