summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-mar.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/strc-mar.lua')
-rw-r--r--tex/context/base/strc-mar.lua29
1 files changed, 21 insertions, 8 deletions
diff --git a/tex/context/base/strc-mar.lua b/tex/context/base/strc-mar.lua
index b3a6e8f35..258787d0a 100644
--- a/tex/context/base/strc-mar.lua
+++ b/tex/context/base/strc-mar.lua
@@ -19,14 +19,27 @@ local commands = commands
local allocate = utilities.storage.allocate
local setmetatableindex = table.setmetatableindex
-local traversenodes = nodes.traverse
+local nuts = nodes.nuts
+local tonut = nuts.tonut
+
+local getfield = nuts.getfield
+local setfield = nuts.setfield
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getattr = nuts.getattr
+local setattr = nuts.setattr
+local getbox = nuts.getbox
+
+local traversenodes = nuts.traverse
+
local nodecodes = nodes.nodecodes
local glyph_code = nodecodes.glyph
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local texsetattribute = tex.setattribute
-local texgetbox = tex.getbox
local a_marks = attributes.private("structure","marks")
@@ -106,9 +119,9 @@ end
local function sweep(head,first,last)
for n in traversenodes(head) do
- local id = n.id
+ local id = getid(n)
if id == glyph_code then
- local a = n[a_marks]
+ local a = getattr(n,a_marks)
if not a then
-- next
elseif first == 0 then
@@ -118,7 +131,7 @@ local function sweep(head,first,last)
end
elseif id == hlist_code or id == vlist_code then
if boxes_too then
- local a = n[a_marks]
+ local a = getattr(n,a_marks)
if not a then
-- next
elseif first == 0 then
@@ -127,7 +140,7 @@ local function sweep(head,first,last)
last = a
end
end
- local list = n.list
+ local list = getlist(n)
if list then
first, last = sweep(list,first,last)
end
@@ -143,9 +156,9 @@ setmetatableindex(classes, function(t,k) local s = settings_to_array(k) t[k] = s
local lasts = { }
function marks.synchronize(class,n,option)
- local box = texgetbox(n)
+ local box = getbox(n)
if box then
- local first, last = sweep(box.list,0,0)
+ local first, last = sweep(getlist(box),0,0)
if option == v_keep and first == 0 and last == 0 then
if trace_marks_get or trace_marks_set then
report_marks("action %a, class %a, box %a","retain at synchronize",class,n)