summaryrefslogtreecommitdiff
path: root/tex/context/base/spac-ali.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-05-03 13:55:34 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-05-03 13:55:34 +0200
commit624cbb5da392e9403984dd1cf368c0d408b1c2a8 (patch)
tree489c049ac849bb5bbce7d32e4df477872c58373d /tex/context/base/spac-ali.lua
parent088de88944c1f2254250bb448c7371a87ff7ee39 (diff)
downloadcontext-624cbb5da392e9403984dd1cf368c0d408b1c2a8.tar.gz
2014-01-03 00:42:00
Diffstat (limited to 'tex/context/base/spac-ali.lua')
-rw-r--r--tex/context/base/spac-ali.lua46
1 files changed, 17 insertions, 29 deletions
diff --git a/tex/context/base/spac-ali.lua b/tex/context/base/spac-ali.lua
index 08e33c5b8..25cc6cd66 100644
--- a/tex/context/base/spac-ali.lua
+++ b/tex/context/base/spac-ali.lua
@@ -10,26 +10,13 @@ local div = math.div
local format = string.format
local tasks = nodes.tasks
+local appendaction = tasks.appendaction
+local prependaction = tasks.prependaction
+local disableaction = tasks.disableaction
local enableaction = tasks.enableaction
-local nuts = nodes.nuts
-local nodepool = nuts.pool
-
-local tonode = nuts.tonode
-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 getsubtype = nuts.getsubtype
-
-local hpack_nodes = nuts.hpack -- nodes.fasthpack not really faster here
-local linked_nodes = nuts.linked
+local slide_nodes = node.slide
+local hpack_nodes = node.hpack -- nodes.fasthpack not really faster here
local unsetvalue = attributes.unsetvalue
@@ -40,6 +27,8 @@ local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local line_code = listcodes.line
+local nodepool = nodes.pool
+
local new_stretch = nodepool.stretch
local a_realign = attributes.private("realign")
@@ -67,10 +56,10 @@ local function handler(head,leftpage,realpageno)
local current = head
local done = false
while current do
- local id = getid(current)
+ local id = current.id
if id == hlist_code then
- if getsubtype(current) == line_code then
- local a = getattr(current,a_realign)
+ if current.subtype == line_code then
+ local a = current[a_realign]
if not a or a == 0 then
-- skip
else
@@ -86,12 +75,12 @@ local function handler(head,leftpage,realpageno)
action = leftpage and 2 or 1
end
if action == 1 then
- setfield(current,"list",hpack_nodes(linked_nodes(getlist(current),new_stretch(3)),getfield(current,"width"),"exactly"))
+ current.list = hpack_nodes(current.list .. new_stretch(3),current.width,"exactly")
if trace_realign then
report_realign("flushing left, align %a, page %a, realpage %a",align,pageno,realpageno)
end
elseif action == 2 then
- setfield(current,"list",hpack_nodes(linked_nodes(new_stretch(3),getlist(current)),getfield(current,"width"),"exactly"))
+ current.list = hpack_nodes(new_stretch(3) .. current.list,current.width,"exactly")
if trace_realign then
report_realign("flushing right. align %a, page %a, realpage %a",align,pageno,realpageno)
end
@@ -101,14 +90,14 @@ local function handler(head,leftpage,realpageno)
done = true
nofrealigned = nofrealigned + 1
end
- setattr(current,a_realign,unsetvalue)
+ current[a_realign] = unsetvalue
end
end
- handler(getlist(current),leftpage,realpageno)
+ handler(current.list,leftpage,realpageno)
elseif id == vlist_code then
- handler(getlist(current),leftpage,realpageno)
+ handler(current.list,leftpage,realpageno)
end
- current = getnext(current)
+ current = current.next
end
return head, done
end
@@ -116,8 +105,7 @@ end
function alignments.handler(head)
local leftpage = isleftpage(true,false)
local realpageno = texgetcount("realpageno")
- local head, done = handler(tonut(head),leftpage,realpageno)
- return tonode(head), done
+ return handler(head,leftpage,realpageno)
end
local enabled = false