summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/typo-ovl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/typo-ovl.lua')
-rw-r--r--tex/context/base/mkiv/typo-ovl.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/typo-ovl.lua b/tex/context/base/mkiv/typo-ovl.lua
index 6f836551d..25b1a0178 100644
--- a/tex/context/base/mkiv/typo-ovl.lua
+++ b/tex/context/base/mkiv/typo-ovl.lua
@@ -34,6 +34,8 @@ local setattrlist = nuts.setattrlist
local getfield = nuts.getfield
local setfont = nuts.setfont
+local nextnode = nuts.traversers.node
+
local unsetvalue = attributes.unsetvalue
local prvattribute = attributes.private
@@ -90,9 +92,9 @@ end
attributes.tooverloads = tooverloads
function attributes.applyoverloads(specification,start,stop)
- local current = tonut(start)
+ local start = tonut(start)
local processor = specification.processor
- local overloads = specification.processor or getattr(current,a_overloads)
+ local overloads = specification.processor or getattr(start,a_overloads)
if overloads and overloads ~= unsetvalue then
overloads = t_overloads[overloads]
if not overloads then
@@ -107,7 +109,7 @@ function attributes.applyoverloads(specification,start,stop)
local newlist = nil
local newfont = overloads.font
- local function apply()
+ local function apply(current)
local a = getattrlist(current)
if a == oldlist then
setattrlist(current,newlist)
@@ -127,12 +129,11 @@ function attributes.applyoverloads(specification,start,stop)
end
end
- while current do
- local id = getid(current)
+ for current, id in nextnode, start do
if id == glyph_code then
- apply()
+ apply(current)
elseif id == disc_code then
- apply()
+ apply(current)
if pre then
while pre do
if getid(pre) == glyph_code then
@@ -161,7 +162,6 @@ function attributes.applyoverloads(specification,start,stop)
if current == last then
break
end
- current = getnext(current)
end
end